From 5d7fa35a1914420dbfa13ff2552829e98ddeaf02 Mon Sep 17 00:00:00 2001 From: Chumva Date: Mon, 5 Mar 2018 11:13:39 +0200 Subject: [PATCH] fixed NPE in MapMarkersWidgetsFactory --- .../plus/views/mapwidgets/MapMarkersWidgetsFactory.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapMarkersWidgetsFactory.java b/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapMarkersWidgetsFactory.java index f19434c14c..86fac1bfea 100644 --- a/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapMarkersWidgetsFactory.java +++ b/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapMarkersWidgetsFactory.java @@ -216,7 +216,10 @@ public class MapMarkersWidgetsFactory { } boolean mapLinkedToLoc = map.getMapViewTrackingUtilities().isMapLinkedToLocation(); - Float heading = !mapLinkedToLoc ? 0f : map.getMapViewTrackingUtilities().getHeading(); + Float heading = 0f; + if (mapLinkedToLoc) { + heading = map.getMapViewTrackingUtilities().getHeading(); + } MapMarker marker = markers.get(0); updateUI(loc, heading, marker, arrowImg, distText, okButton, addressText, true, customLocation != null);