From 19f23a38d3a60efe57cc5833cff408cbcc25ab05 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Wed, 21 Oct 2015 15:54:47 +0200 Subject: [PATCH] Fix npe --- OsmAnd/src/net/osmand/plus/download/DownloadActivity.java | 4 +++- .../src/net/osmand/plus/download/ui/LocalIndexesFragment.java | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/download/DownloadActivity.java b/OsmAnd/src/net/osmand/plus/download/DownloadActivity.java index db6c299eb2..1d7df6fa27 100644 --- a/OsmAnd/src/net/osmand/plus/download/DownloadActivity.java +++ b/OsmAnd/src/net/osmand/plus/download/DownloadActivity.java @@ -76,7 +76,8 @@ public class DownloadActivity extends BaseDownloadActivity { updateDescriptionTextWithSize(this, downloadProgressLayout); int currentTab = 0; String tab = getIntent() == null || getIntent().getExtras() == null ? null : getIntent().getExtras().getString(TAB_TO_OPEN); - switch (tab) { + if (tab != null) { + switch (tab) { case DOWNLOAD_TAB: currentTab = DOWNLOAD_TAB_NUMBER; break; @@ -86,6 +87,7 @@ public class DownloadActivity extends BaseDownloadActivity { case UPDATES_TAB: currentTab = UPDATES_TAB_NUMBER; break; + } } viewPager = (ViewPager) findViewById(R.id.pager); diff --git a/OsmAnd/src/net/osmand/plus/download/ui/LocalIndexesFragment.java b/OsmAnd/src/net/osmand/plus/download/ui/LocalIndexesFragment.java index 1222e999b6..68b461f473 100644 --- a/OsmAnd/src/net/osmand/plus/download/ui/LocalIndexesFragment.java +++ b/OsmAnd/src/net/osmand/plus/download/ui/LocalIndexesFragment.java @@ -1054,7 +1054,7 @@ public class LocalIndexesFragment extends OsmandExpandableListFragment implement if (child.getSize() > 100) { builder.append(DownloadActivity.formatMb.format(new Object[]{(float) child.getSize() / (1 << 10)})); } else { - builder.append(child.getSize()).append(" kB"); + builder.append(child.getSize()).append(" KB"); } builder.append(" • "); }