From 6f5a4d5bba7e627d7978a3f9baac19300479beaa Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Tue, 26 May 2020 12:27:27 +0300 Subject: [PATCH] Fix possible npe --- OsmAnd/src/net/osmand/plus/AppInitializer.java | 2 +- .../src/net/osmand/plus/views/MapQuickActionLayer.java | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/AppInitializer.java b/OsmAnd/src/net/osmand/plus/AppInitializer.java index f09785122e..c39fe3a9d5 100644 --- a/OsmAnd/src/net/osmand/plus/AppInitializer.java +++ b/OsmAnd/src/net/osmand/plus/AppInitializer.java @@ -554,7 +554,7 @@ public class AppInitializer implements IProgress { customConfigs.put(fileName, builder); } catch (XmlPullParserException | IOException e) { Algorithms.removeAllFiles(f); - LOG.error(e); + LOG.error(e.getMessage(), e); } } } diff --git a/OsmAnd/src/net/osmand/plus/views/MapQuickActionLayer.java b/OsmAnd/src/net/osmand/plus/views/MapQuickActionLayer.java index 33344bcf3a..c425e1774d 100644 --- a/OsmAnd/src/net/osmand/plus/views/MapQuickActionLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/MapQuickActionLayer.java @@ -394,9 +394,13 @@ public class MapQuickActionLayer extends OsmandMapLayer implements QuickActionRe contextMarker.draw(canvas); } if (this.nightMode != nightMode) { - this.nightMode = nightMode; - updateQuickActionButton(currentWidgetState != null && currentWidgetState); - } + this.nightMode = nightMode; + boolean widgetVisible = false; + if (currentWidgetState != null) { + widgetVisible = currentWidgetState; + } + updateQuickActionButton(widgetVisible); + } setupQuickActionBtnVisibility(); }