OSDN Git Service

Avoid NPE in isEmpty() when no EditFields defined.
authorJeff Sharkey <jsharkey@android.com>
Fri, 30 Oct 2009 20:41:53 +0000 (13:41 -0700)
committerJeff Sharkey <jsharkey@android.com>
Fri, 30 Oct 2009 20:58:54 +0000 (13:58 -0700)
Fixes http://b/2226220

src/com/android/contacts/model/EntityModifier.java

index 519ff80..fb3eba7 100644 (file)
@@ -409,6 +409,9 @@ public class EntityModifier {
      * terms of {@link DataKind#fieldList}.
      */
     public static boolean isEmpty(ValuesDelta values, DataKind kind) {
+        // No defined fields mean this row is always empty
+        if (kind.fieldList == null) return true;
+
         boolean hasValues = false;
         for (EditField field : kind.fieldList) {
             // If any field has values, we're not empty