Avoid NPE when callers send null selection args.

Fixes http://b/2226007
This commit is contained in:
Jeff Sharkey
2009-10-29 16:39:36 -07:00
parent 3a8141416a
commit 824838d74e

View File

@@ -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;
}