Fixed NPE in DashDownloadMapFragment
This commit is contained in:
parent
238b886ea6
commit
7ec0c9f3a6
2 changed files with 7 additions and 2 deletions
|
@ -9,6 +9,9 @@ import net.osmand.plus.OsmandApplication;
|
|||
public class DashBaseFragment extends SherlockFragment {
|
||||
|
||||
public OsmandApplication getMyApplication(){
|
||||
if (getActivity() == null){
|
||||
return null;
|
||||
}
|
||||
return (OsmandApplication) getActivity().getApplication();
|
||||
}
|
||||
|
||||
|
|
|
@ -84,7 +84,8 @@ public class DashDownloadMapsFragment extends DashBaseFragment {
|
|||
}
|
||||
|
||||
protected void updateCount(String s) {
|
||||
if (!DashDownloadMapsFragment.this.isAdded()){
|
||||
if (!DashDownloadMapsFragment.this.isAdded() ||
|
||||
getMyApplication() == null){
|
||||
return;
|
||||
}
|
||||
File ms = getMyApplication().getAppPath(s);
|
||||
|
@ -104,7 +105,8 @@ public class DashDownloadMapsFragment extends DashBaseFragment {
|
|||
@Override
|
||||
protected void onPostExecute(Void result) {
|
||||
super.onPostExecute(result);
|
||||
if (!DashDownloadMapsFragment.this.isAdded()){
|
||||
if (!DashDownloadMapsFragment.this.isAdded()
|
||||
|| getMyApplication() == null){
|
||||
return;
|
||||
}
|
||||
if(countMaps > 0) {
|
||||
|
|
Loading…
Reference in a new issue