diff options
author | lado <herrlado@gmail.com> | 2011-10-10 01:14:12 +0200 |
---|---|---|
committer | lado <herrlado@gmail.com> | 2011-10-10 01:14:12 +0200 |
commit | 059cdf88dafbf00f777bb5c52994734517637c32 (patch) | |
tree | 7d2f8e05f42c426a55b594696064d815dc557d0a | |
parent | ea30c8114bf099f2fdd96994569c57393a4e08c3 (diff) | |
download | vdr-manager-059cdf88dafbf00f777bb5c52994734517637c32.tar.gz vdr-manager-059cdf88dafbf00f777bb5c52994734517637c32.tar.bz2 |
avoid npe
-rw-r--r-- | vdrmanager/src/de/bjusystems/vdrmanager/gui/RecordingListActivity.java | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/gui/RecordingListActivity.java b/vdrmanager/src/de/bjusystems/vdrmanager/gui/RecordingListActivity.java index 1d1f288..20ba517 100644 --- a/vdrmanager/src/de/bjusystems/vdrmanager/gui/RecordingListActivity.java +++ b/vdrmanager/src/de/bjusystems/vdrmanager/gui/RecordingListActivity.java @@ -173,6 +173,13 @@ public class RecordingListActivity extends BaseActivity implements task.run(); } + + private void dismiss(){ + if (progress != null) { + progress.dismiss(); + } + } + public void svdrpEvent(final SvdrpEvent event, final Recording result) { if (progress != null) { @@ -186,7 +193,7 @@ public class RecordingListActivity extends BaseActivity implements case CONNECT_ERROR: switchNoConnection();// TODO pass arg, what is the problem case LOGIN_ERROR: - progress.dismiss(); + dismiss(); switchNoConnection(); break; case FINISHED_SUCCESS: @@ -204,10 +211,7 @@ public class RecordingListActivity extends BaseActivity implements adapter.add(new EventListItem(rec)); } // adapter.sortItems(); - if (progress != null) { - progress.dismiss(); - progress = null; - } + dismiss(); if (recordingClient.getResults().isEmpty()) { Toast.makeText(RecordingListActivity.this, R.string.epg_no_items, Toast.LENGTH_SHORT).show(); |