From 059cdf88dafbf00f777bb5c52994734517637c32 Mon Sep 17 00:00:00 2001 From: lado Date: Mon, 10 Oct 2011 01:14:12 +0200 Subject: avoid npe --- .../bjusystems/vdrmanager/gui/RecordingListActivity.java | 14 +++++++++----- 1 file 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(); -- cgit v1.2.3