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

Merge commit '824838d74eb0316f6987a1d98d2d9e9fa8d4e15b' into eclair-mr2

* commit '824838d74eb0316f6987a1d98d2d9e9fa8d4e15b':
  Avoid NPE when callers send null selection args.
This commit is contained in:
Jeff Sharkey
2009-10-29 19:35:32 -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;
}