am 12b5e504: Merge "Fix NPE in Transport.applyBatch" into lmp-mr1-dev

* commit '12b5e504fd3845fed9c649cf01cd27b84fb6742c':
  Fix NPE in Transport.applyBatch
This commit is contained in:
Jay Shrauner
2014-12-16 00:55:11 +00:00
committed by Android Git Automerger

View File

@@ -286,10 +286,12 @@ public abstract class ContentProvider implements ComponentCallbacks2 {
final String original = setCallingPackage(callingPkg);
try {
ContentProviderResult[] results = ContentProvider.this.applyBatch(operations);
for (int i = 0; i < results.length ; i++) {
if (userIds[i] != UserHandle.USER_CURRENT) {
// Adding the userId to the uri.
results[i] = new ContentProviderResult(results[i], userIds[i]);
if (results != null) {
for (int i = 0; i < results.length ; i++) {
if (userIds[i] != UserHandle.USER_CURRENT) {
// Adding the userId to the uri.
results[i] = new ContentProviderResult(results[i], userIds[i]);
}
}
}
return results;