diff options
author | Tammo Spalink <tammo@google.com> | 2009-09-08 18:30:33 +0800 |
---|---|---|
committer | Tammo Spalink <tammo@google.com> | 2009-09-08 18:30:33 +0800 |
commit | 0bb9960598067f3320cdae8ab42c1ba0f3376f21 (patch) | |
tree | 1541860a216ce148dce857f582210a09567931fa /core/java/android/preference | |
parent | 7390c5af7a0c2379fa72218ea63a714f843edf0f (diff) | |
download | frameworks_base-0bb9960598067f3320cdae8ab42c1ba0f3376f21.zip frameworks_base-0bb9960598067f3320cdae8ab42c1ba0f3376f21.tar.gz frameworks_base-0bb9960598067f3320cdae8ab42c1ba0f3376f21.tar.bz2 |
Do not die when printing empty prefs.
Addresses issue:
http://buganizer/issue?id=1974140
Change-Id: I0001d69e8d278d4ca900f5ce56ad50c0b4b6b694
Diffstat (limited to 'core/java/android/preference')
-rw-r--r-- | core/java/android/preference/Preference.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/core/java/android/preference/Preference.java b/core/java/android/preference/Preference.java index fc39573..08a2a9f 100644 --- a/core/java/android/preference/Preference.java +++ b/core/java/android/preference/Preference.java @@ -1456,8 +1456,10 @@ public class Preference implements Comparable<Preference>, OnDependencyChangeLis if (!TextUtils.isEmpty(summary)) { sb.append(summary).append(' '); } - // Drop the last space - sb.setLength(sb.length() - 1); + if (sb.length() > 0) { + // Drop the last space + sb.setLength(sb.length() - 1); + } return sb; } |