am 5546e9e6: am 824838d7: Avoid NPE when callers send null selection args.

Merge commit '5546e9e6721a5b05678ea6ceb3be433219f53fe6' into eclair-mr2-plus-aosp

* commit '5546e9e6721a5b05678ea6ceb3be433219f53fe6':
  Avoid NPE when callers send null selection args.
This commit is contained in:
Jeff Sharkey
2009-10-29 19:59:50 -07:00
committed by Android Git Automerger

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