summaryrefslogtreecommitdiff
path: root/vdrmanager/src/de
diff options
context:
space:
mode:
authorlado <herrlado@gmail.com>2012-01-22 02:53:22 +0100
committerlado <herrlado@gmail.com>2012-01-22 02:53:22 +0100
commit71cd552798123fc6b600b4d727ca245b4d62893c (patch)
tree4d120ce10a781a1cba8ba89255ce792c860afab4 /vdrmanager/src/de
parent43030973ed351e0e4ef4e325cf7a793be2d7ea69 (diff)
downloadvdr-manager-71cd552798123fc6b600b4d727ca245b4d62893c.tar.gz
vdr-manager-71cd552798123fc6b600b4d727ca245b4d62893c.tar.bz2
npe fix
Diffstat (limited to 'vdrmanager/src/de')
-rw-r--r--vdrmanager/src/de/bjusystems/vdrmanager/gui/Utils.java14
1 files changed, 12 insertions, 2 deletions
diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/gui/Utils.java b/vdrmanager/src/de/bjusystems/vdrmanager/gui/Utils.java
index 48b3389..7998936 100644
--- a/vdrmanager/src/de/bjusystems/vdrmanager/gui/Utils.java
+++ b/vdrmanager/src/de/bjusystems/vdrmanager/gui/Utils.java
@@ -97,11 +97,21 @@ public class Utils {
&& now < event.getStop().getTime();
}
+ private static String trimToEmpty(String str){
+ if(str == null){
+ return "";
+ }
+ if(TextUtils.isEmpty(str)){
+ return "";
+ }
+ return str;
+ }
+
private static String getBaseUrl() {
StringBuilder sb = new StringBuilder();
Preferences p = Preferences.getPreferences();
- String auth = p.getStreamingUsername().trim() + ":"
- + p.getStreamingPassword();
+ String auth = trimToEmpty(p.getStreamingUsername()) + ":"
+ + trimToEmpty(p.getStreamingPassword());
if (auth.length() == 1) {
auth = "";
} else {