From cfd8d5c85dd5b131cba9e5b82313e3e974c56118 Mon Sep 17 00:00:00 2001 From: lado Date: Tue, 24 Jan 2012 16:35:19 +0100 Subject: null in getPassword fixed --- vdrmanager/src/de/bjusystems/vdrmanager/StringUtils.java | 4 ++++ vdrmanager/src/de/bjusystems/vdrmanager/data/Preferences.java | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/StringUtils.java b/vdrmanager/src/de/bjusystems/vdrmanager/StringUtils.java index 18e1d88..b440055 100644 --- a/vdrmanager/src/de/bjusystems/vdrmanager/StringUtils.java +++ b/vdrmanager/src/de/bjusystems/vdrmanager/StringUtils.java @@ -1,3 +1,4 @@ + package de.bjusystems.vdrmanager; import java.util.ArrayList; @@ -10,6 +11,9 @@ public class StringUtils { * An empty immutable String array. */ public static final String[] EMPTY_STRING_ARRAY = new String[0]; + + + public static final String EMPTY_STRING = ""; /** diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/data/Preferences.java b/vdrmanager/src/de/bjusystems/vdrmanager/data/Preferences.java index aa70a32..640060f 100644 --- a/vdrmanager/src/de/bjusystems/vdrmanager/data/Preferences.java +++ b/vdrmanager/src/de/bjusystems/vdrmanager/data/Preferences.java @@ -10,6 +10,7 @@ import android.content.res.Configuration; import android.text.TextUtils; import android.widget.Toast; import de.bjusystems.vdrmanager.R; +import de.bjusystems.vdrmanager.StringUtils; import de.bjusystems.vdrmanager.app.Intents; import de.bjusystems.vdrmanager.data.db.OrmDatabaseHelper; import de.bjusystems.vdrmanager.gui.VdrListActivity; @@ -207,7 +208,11 @@ public class Preferences { * @return SVDRO password */ public String getPassword() { - return getCurrentVdr().getPassword(); + String pwd = getCurrentVdr().getPassword(); + if(pwd == null){ + return StringUtils.EMPTY_STRING; + } + return pwd; } /** -- cgit v1.2.3