Fix crash while selecting poi on map

This commit is contained in:
Alexey Kulish 2016-10-20 15:34:39 +03:00
parent 42753e0ff0
commit 25e1ff5b40

View file

@ -390,7 +390,7 @@ public class ContextMenuLayer extends OsmandMapLayer {
MapRenderRepositories maps = activity.getMyApplication().getResourceManager().getRenderer();
RenderingContext rc = maps.getVisibleRenderingContext();
RenderedObject[] renderedObjects = null;
if (rc.zoom == tileBox.getZoom()) {
if (rc != null && rc.zoom == tileBox.getZoom()) {
double lat = MapUtils.get31LatitudeY((int) (rc.topY * rc.tileDivisor));
double lon = MapUtils.get31LongitudeX((int) (rc.leftX * rc.tileDivisor));
float x = tileBox.getPixXFromLatLon(lat, lon);