Catch a rare NPE due in SuggestionController

In monkey test, suggestion service can detach right before UI tries to query.

Change-Id: Ic2eeb81140f5b5d38688fbe92d20f68b9fa48c34
Fixes: 69979152
Test: monkey
This commit is contained in:
Fan Zhang
2017-12-05 10:36:08 -08:00
parent caf5358e40
commit 5f3716d1de

View File

@@ -104,6 +104,9 @@ public class SuggestionController {
}
try {
return mRemoteService.getSuggestions();
} catch (NullPointerException e) {
Log.w(TAG, "mRemote service detached before able to query", e);
return null;
} catch (RemoteException e) {
Log.w(TAG, "Error when calling getSuggestion()", e);
return null;