diff options
| -rw-r--r-- | core/java/android/content/ContentProviderOperation.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/core/java/android/content/ContentProviderOperation.java b/core/java/android/content/ContentProviderOperation.java index 0467516b4b84..ca36df2fbebb 100644 --- a/core/java/android/content/ContentProviderOperation.java +++ b/core/java/android/content/ContentProviderOperation.java @@ -545,8 +545,12 @@ public class ContentProviderOperation implements Parcelable { "only updates, deletes, and asserts can have selections"); } mSelection = selection; - mSelectionArgs = new String[selectionArgs.length]; - System.arraycopy(selectionArgs, 0, mSelectionArgs, 0, selectionArgs.length); + if (selectionArgs == null) { + mSelectionArgs = null; + } else { + mSelectionArgs = new String[selectionArgs.length]; + System.arraycopy(selectionArgs, 0, mSelectionArgs, 0, selectionArgs.length); + } return this; } |