From 3eb4baafc0a50097c881a53e8072ace9c776b227 Mon Sep 17 00:00:00 2001 From: Marco Nelissen Date: Mon, 24 Jul 2017 13:35:29 -0700 Subject: Add null check Bundle returned from ContentProvider.call() may be null, and content command shouldn't crash because of that. Test: manual Change-Id: I4c7e6c2b607b065699b58e6b9bca20e84cdb19ca --- cmds/content/src/com/android/commands/content/Content.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'cmds/content/src') diff --git a/cmds/content/src/com/android/commands/content/Content.java b/cmds/content/src/com/android/commands/content/Content.java index 3687f10f9974..716bc5f24631 100644 --- a/cmds/content/src/com/android/commands/content/Content.java +++ b/cmds/content/src/com/android/commands/content/Content.java @@ -535,7 +535,9 @@ public class Content { @Override public void onExecute(IContentProvider provider) throws Exception { Bundle result = provider.call(null, mMethod, mArg, mExtras); - final int size = result.size(); // unpack + if (result != null) { + result.size(); // unpack + } System.out.println("Result: " + result); } } -- cgit v1.2.3-59-g8ed1b