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() {
|
||||
String preferredLang = getPreferredMapLang();
|
||||
if (amenity.getType().isWiki()) {
|
||||
OsmandApplication app = getMapActivity().getMyApplication();
|
||||
preferredLang = WikipediaPoiMenu.getWikiArticleLanguage(app,
|
||||
amenity.getSupportedContentLocales(), getPreferredMapAppLang());
|
||||
MapActivity mapActivity = getMapActivity();
|
||||
if (mapActivity != null) {
|
||||
OsmandApplication app = mapActivity.getMyApplication();
|
||||
preferredLang = WikipediaPoiMenu.getWikiArticleLanguage(app,
|
||||
amenity.getSupportedContentLocales(), getPreferredMapAppLang());
|
||||
}
|
||||
}
|
||||
String name = amenity.getName(preferredLang, isTransliterateNames());
|
||||
Map<String, String> additionalInfo = amenity.getAdditionalInfo();
|
||||
|
|
Loading…
Reference in a new issue