diff options
author | Joe Onorato <joeo@android.com> | 2010-02-01 18:14:15 -0500 |
---|---|---|
committer | Joe Onorato <joeo@android.com> | 2010-02-01 18:14:15 -0500 |
commit | 7747210426f0169b7f10f47a66d15a754b36d64c (patch) | |
tree | 34590af50f2ecb3e709d0b9783fbb8046d34f9f9 /core/java/android/widget/DateTimeView.java | |
parent | 5fdff9e6c50faa6196349e8aecc08d0b9bc5467d (diff) | |
download | frameworks_base-7747210426f0169b7f10f47a66d15a754b36d64c.zip frameworks_base-7747210426f0169b7f10f47a66d15a754b36d64c.tar.gz frameworks_base-7747210426f0169b7f10f47a66d15a754b36d64c.tar.bz2 |
Fix bug 2389454 - DateTimeView can NPE if "date_format" isn't set in Settings.
Diffstat (limited to 'core/java/android/widget/DateTimeView.java')
-rw-r--r-- | core/java/android/widget/DateTimeView.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/java/android/widget/DateTimeView.java b/core/java/android/widget/DateTimeView.java index 9067e26..3dab9f2 100644 --- a/core/java/android/widget/DateTimeView.java +++ b/core/java/android/widget/DateTimeView.java @@ -203,7 +203,7 @@ public class DateTimeView extends TextView { private DateFormat getDateFormat() { String format = Settings.System.getString(getContext().getContentResolver(), Settings.System.DATE_FORMAT); - if ("".equals(format)) { + if (format == null || "".equals(format)) { return DateFormat.getDateInstance(DateFormat.SHORT); } else { return new SimpleDateFormat(format); |