check MapActivity reference on null
This commit is contained in:
parent
4b6d0b28eb
commit
cfea326efc
1 changed files with 6 additions and 3 deletions
|
@ -160,9 +160,12 @@ 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();
|
||||||
preferredLang = WikipediaPoiMenu.getWikiArticleLanguage(app,
|
if (mapActivity != null) {
|
||||||
amenity.getSupportedContentLocales(), getPreferredMapAppLang());
|
OsmandApplication app = mapActivity.getMyApplication();
|
||||||
|
preferredLang = WikipediaPoiMenu.getWikiArticleLanguage(app,
|
||||||
|
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();
|
||||||
|
|
Loading…
Reference in a new issue