diff options
| -rw-r--r-- | services/core/java/com/android/server/location/contexthub/ContextHubService.java | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/services/core/java/com/android/server/location/contexthub/ContextHubService.java b/services/core/java/com/android/server/location/contexthub/ContextHubService.java index ed451ff0c194..7de10452191e 100644 --- a/services/core/java/com/android/server/location/contexthub/ContextHubService.java +++ b/services/core/java/com/android/server/location/contexthub/ContextHubService.java @@ -333,8 +333,14 @@ public class ContextHubService extends IContextHubService.Stub { return new IContextHubClientCallback.Stub() { private void finishCallback() { try { - IContextHubClient client = mDefaultClientMap.get(contextHubId); - client.callbackFinished(); + if (mDefaultClientMap != null && mDefaultClientMap.containsKey(contextHubId)) { + IContextHubClient client = mDefaultClientMap.get(contextHubId); + client.callbackFinished(); + } else { + Log.e(TAG, "Default client not found for hub (ID = " + contextHubId + "): " + + mDefaultClientMap == null ? "map was null" + : "map did not contain the hub"); + } } catch (RemoteException e) { Log.e( TAG, |