From 2ebc2fb9d1878735e5d32b2e964aeb1ffac39a7e Mon Sep 17 00:00:00 2001 From: Alexey Kulish Date: Mon, 26 Oct 2015 22:19:31 +0300 Subject: [PATCH] Fix empty regions issue --- .../src/net/osmand/plus/download/DownloadIndexesThread.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/download/DownloadIndexesThread.java b/OsmAnd/src/net/osmand/plus/download/DownloadIndexesThread.java index e2cda09e84..e061a69aaf 100644 --- a/OsmAnd/src/net/osmand/plus/download/DownloadIndexesThread.java +++ b/OsmAnd/src/net/osmand/plus/download/DownloadIndexesThread.java @@ -294,13 +294,14 @@ public class DownloadIndexesThread { @Override protected DownloadResources doInBackground(Void... params) { - DownloadResources result = new DownloadResources(app); + DownloadResources result = null; DownloadOsmandIndexesHelper.IndexFileList indexFileList = DownloadOsmandIndexesHelper.getIndexesList(ctx); if (indexFileList != null) { try { while (app.isApplicationInitializing()) { Thread.sleep(200); } + result = new DownloadResources(app); result.isDownloadedFromInternet = indexFileList.isDownloadedFromInternet(); result.mapVersionIsIncreased = indexFileList.isIncreasedMapVersion(); app.getSettings().LAST_CHECKED_UPDATES.set(System.currentTimeMillis()); @@ -308,7 +309,7 @@ public class DownloadIndexesThread { } catch (Exception e) { } } - return result; + return result == null ? new DownloadResources(app) : result; } protected void onPostExecute(DownloadResources result) {