From 31b69c486c376050c376d127a744caf3762f1424 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Sat, 26 May 2018 11:25:57 +0200 Subject: [PATCH] Avoid potential crash --- .../osmand/plus/resources/IncrementalChangesManager.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/resources/IncrementalChangesManager.java b/OsmAnd/src/net/osmand/plus/resources/IncrementalChangesManager.java index bfa84f2fdf..9c965ab78b 100644 --- a/OsmAnd/src/net/osmand/plus/resources/IncrementalChangesManager.java +++ b/OsmAnd/src/net/osmand/plus/resources/IncrementalChangesManager.java @@ -161,10 +161,12 @@ public class IncrementalChangesManager { if(date.endsWith("00")) { monthUpdates.put(monthYear, ru); } else { - if (!dayUpdates.containsKey(monthYear)) { - dayUpdates.put(monthYear, new ArrayList()); + List list = dayUpdates.get(monthYear); + if (list == null) { + list = new ArrayList(); } - dayUpdates.get(monthYear).add(ru); + list.add(ru); + dayUpdates.put(monthYear, list); } return true; }