check MapActivity reference on null
This commit is contained in:
parent
4b6d0b28eb
commit
cfea326efc
1 changed files with 6 additions and 3 deletions
|
@ -160,10 +160,13 @@ public class AmenityMenuController extends MenuController {
|
||||||
public String getNameStr() {
|
public String getNameStr() {
|
||||||
String preferredLang = getPreferredMapLang();
|
String preferredLang = getPreferredMapLang();
|
||||||
if (amenity.getType().isWiki()) {
|
if (amenity.getType().isWiki()) {
|
||||||
OsmandApplication app = getMapActivity().getMyApplication();
|
MapActivity mapActivity = getMapActivity();
|
||||||
|
if (mapActivity != null) {
|
||||||
|
OsmandApplication app = mapActivity.getMyApplication();
|
||||||
preferredLang = WikipediaPoiMenu.getWikiArticleLanguage(app,
|
preferredLang = WikipediaPoiMenu.getWikiArticleLanguage(app,
|
||||||
amenity.getSupportedContentLocales(), getPreferredMapAppLang());
|
amenity.getSupportedContentLocales(), getPreferredMapAppLang());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
String name = amenity.getName(preferredLang, isTransliterateNames());
|
String name = amenity.getName(preferredLang, isTransliterateNames());
|
||||||
Map<String, String> additionalInfo = amenity.getAdditionalInfo();
|
Map<String, String> additionalInfo = amenity.getAdditionalInfo();
|
||||||
if (additionalInfo != null) {
|
if (additionalInfo != null) {
|
||||||
|
|
Loading…
Reference in a new issue