summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMichael Chan <mchan@android.com>2012-09-26 15:22:18 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2012-09-26 15:22:18 -0700
commit5bd6f4d7b4a5a2d28fec4853b81c8f4ea6f63fdc (patch)
treeb0c83dfb8afa56643c81dacef1e31bcdc38d53cf /src
parent5497333b44ea8bbbfada0562f82385431d1161a1 (diff)
parent196bc3a5abc035171ce81537531fef776427f393 (diff)
downloadandroid_packages_apps_Calendar-5bd6f4d7b4a5a2d28fec4853b81c8f4ea6f63fdc.tar.gz
android_packages_apps_Calendar-5bd6f4d7b4a5a2d28fec4853b81c8f4ea6f63fdc.tar.bz2
android_packages_apps_Calendar-5bd6f4d7b4a5a2d28fec4853b81c8f4ea6f63fdc.zip
am 196bc3a5: Merge "Fixed NPE in matrixCursorFromCursor" into ics-ub-calendar-aqua
* commit '196bc3a5abc035171ce81537531fef776427f393': Fixed NPE in matrixCursorFromCursor
Diffstat (limited to 'src')
-rw-r--r--src/com/android/calendar/Utils.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/com/android/calendar/Utils.java b/src/com/android/calendar/Utils.java
index 42a2891c..f301324b 100644
--- a/src/com/android/calendar/Utils.java
+++ b/src/com/android/calendar/Utils.java
@@ -264,8 +264,8 @@ public class Utils {
public static void setSharedPreference(Context context, String key, String[] values) {
SharedPreferences prefs = GeneralPreferences.getSharedPreferences(context);
LinkedHashSet<String> set = new LinkedHashSet<String>();
- for (int i = 0; i < values.length; i++) {
- set.add(values[i]);
+ for (String value : values) {
+ set.add(value);
}
prefs.edit().putStringSet(key, set).apply();
}
@@ -321,6 +321,10 @@ public class Utils {
}
public static MatrixCursor matrixCursorFromCursor(Cursor cursor) {
+ if (cursor == null) {
+ return null;
+ }
+
String[] columnNames = cursor.getColumnNames();
if (columnNames == null) {
columnNames = new String[] {};