From 3dd85fbf45ef072082fe096e8df857f39f315f23 Mon Sep 17 00:00:00 2001 From: lado Date: Fri, 4 Nov 2011 10:28:07 +0100 Subject: avoid npe on compare --- .../vdrmanager/gui/BaseEventListActivity.java | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'vdrmanager/src/de/bjusystems') diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/gui/BaseEventListActivity.java b/vdrmanager/src/de/bjusystems/vdrmanager/gui/BaseEventListActivity.java index 463e03d..a5679c6 100644 --- a/vdrmanager/src/de/bjusystems/vdrmanager/gui/BaseEventListActivity.java +++ b/vdrmanager/src/de/bjusystems/vdrmanager/gui/BaseEventListActivity.java @@ -106,7 +106,8 @@ public abstract class BaseEventListActivity extends } /** - * Prepare the current event and the chained events for + * Prepare the current event and the chained events for + * * @param event */ protected void prepareDetailsViewData(EventListItem event) { @@ -314,15 +315,16 @@ public abstract class BaseEventListActivity extends if (c != 0) { return c; } - if(item1.getChannelNumber() == null && item2.getChannelNumber() == null){ + if (item1.getChannelNumber() == null + && item2.getChannelNumber() == null) { return 0; } - if(item1.getChannelNumber() == null){ - return -1; - } - if(item2.getChannelNumber() == null){ + if (item1.getChannelNumber() == null) { return 1; } + if (item2.getChannelNumber() == null) { + return -1; + } return Integer.valueOf(item1.getChannelNumber()).compareTo( Integer.valueOf(item2.getChannelNumber())); } @@ -338,7 +340,8 @@ public abstract class BaseEventListActivity extends abstract protected boolean finishedSuccessImpl(); protected final boolean finishedSuccess() { - setTitle(getString(R.string.epg_window_title_count, getWindowTitle(), results.size())); + setTitle(getString(R.string.epg_window_title_count, getWindowTitle(), + results.size())); return finishedSuccessImpl(); } -- cgit v1.2.3