check MapActivity reference on null

This commit is contained in:
Nazar-Kutz 2020-04-30 11:24:30 +03:00
parent 4b6d0b28eb
commit cfea326efc

View file

@ -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();