commit | ab17d3a113b190aedf9282d4667cc39e130d3bd3 | [log] [tgz] |
---|---|---|
author | Daniel 2 Olofsson <daniel2.olofsson@sonymobile.com> | Thu Jan 17 12:05:34 2013 +0100 |
committer | Jeff Sharkey <jsharkey@android.com> | Wed Jun 29 14:53:28 2016 -0600 |
tree | 09cb9e9608510bccd9c4e09c3a0322c04755100a | |
parent | 55e82ab60fc1da497317670108ab508088ac276c [diff] |
Fix NativeDaemonConnectorException issue accessing null object When function getCode is called on NativeDaemonConnectorException object it may throw exception due to mEvent object not being set for certain constructors. Fix is to return a default error code as expected if mEvent object has not been set rather than trying to call mEvent.getCode(). Change-Id: Ia8aa23deb8871bb4df73096cc489b685a1765f16
diff --git a/services/core/java/com/android/server/NativeDaemonConnectorException.java b/services/core/java/com/android/server/NativeDaemonConnectorException.java index 590bbcc..4d8881c 100644 --- a/services/core/java/com/android/server/NativeDaemonConnectorException.java +++ b/services/core/java/com/android/server/NativeDaemonConnectorException.java
@@ -41,7 +41,7 @@ } public int getCode() { - return mEvent.getCode(); + return mEvent != null ? mEvent.getCode() : -1; } public String getCmd() {