diff options
author | lado <herrlado@gmail.com> | 2012-01-20 17:34:32 +0100 |
---|---|---|
committer | lado <herrlado@gmail.com> | 2012-01-20 17:34:32 +0100 |
commit | 116a52618813527384d98076bcad0874233a5260 (patch) | |
tree | ed25974be3caa1fa1b487514a99b66d58abb6ba0 /vdrmanager | |
parent | 97064dcd3e6e4bbfbd2a0c3edb8b60cfbc21687b (diff) | |
download | vdr-manager-116a52618813527384d98076bcad0874233a5260.tar.gz vdr-manager-116a52618813527384d98076bcad0874233a5260.tar.bz2 |
fix possible nfe
Diffstat (limited to 'vdrmanager')
-rw-r--r-- | vdrmanager/src/de/bjusystems/vdrmanager/data/Preferences.java | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/data/Preferences.java b/vdrmanager/src/de/bjusystems/vdrmanager/data/Preferences.java index 12a5757..652fd31 100644 --- a/vdrmanager/src/de/bjusystems/vdrmanager/data/Preferences.java +++ b/vdrmanager/src/de/bjusystems/vdrmanager/data/Preferences.java @@ -7,6 +7,7 @@ import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; import android.content.res.Configuration; +import android.text.TextUtils; import android.widget.Toast; import de.bjusystems.vdrmanager.R; import de.bjusystems.vdrmanager.data.db.OrmDatabaseHelper; @@ -622,6 +623,9 @@ public class Preferences { private static int getInt(final Context context, final int resId, final int defValue) { final String value = getString(context, resId, String.valueOf(defValue)); + if(TextUtils.isEmpty(value) || !TextUtils.isDigitsOnly(value)){ + return 0; + } return Integer.parseInt(value); } |