From 116a52618813527384d98076bcad0874233a5260 Mon Sep 17 00:00:00 2001 From: lado Date: Fri, 20 Jan 2012 17:34:32 +0100 Subject: fix possible nfe --- vdrmanager/src/de/bjusystems/vdrmanager/data/Preferences.java | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'vdrmanager/src/de') 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); } -- cgit v1.2.3