Merge pull request #1015 from Bars107/master

NPE fixes.
This commit is contained in:
Denis 2014-12-19 13:51:57 +02:00
commit 84ae9366a1
2 changed files with 7 additions and 1 deletions

View file

@ -138,7 +138,7 @@ public class MainMenuActivity extends BaseDownloadActivity implements OsmAndLoca
@Override @Override
public void onScrollChanged() { public void onScrollChanged() {
int scrollY = mainScroll.getScrollY(); int scrollY = mainScroll.getScrollY();
if (previousScroll == scrollY){ if (previousScroll == scrollY || mainScroll.getChildAt(0) == null){
return; return;
} }

View file

@ -84,6 +84,9 @@ public class DashDownloadMapsFragment extends DashBaseFragment {
} }
protected void updateCount(String s) { protected void updateCount(String s) {
if (DashDownloadMapsFragment.this.isDetached()){
return;
}
File ms = getMyApplication().getAppPath(s); File ms = getMyApplication().getAppPath(s);
if (ms.exists()) { if (ms.exists()) {
File[] lf = ms.listFiles(); File[] lf = ms.listFiles();
@ -101,6 +104,9 @@ public class DashDownloadMapsFragment extends DashBaseFragment {
@Override @Override
protected void onPostExecute(Void result) { protected void onPostExecute(Void result) {
super.onPostExecute(result); super.onPostExecute(result);
if (DashDownloadMapsFragment.this.isDetached()){
return;
}
if(countMaps > 0) { if(countMaps > 0) {
long mb = 1 << 20; long mb = 1 << 20;
long gb = 1 << 30; long gb = 1 << 30;