diff options
author | Joey Grover <joeygrover@gmail.com> | 2016-06-21 16:20:21 -0400 |
---|---|---|
committer | Joey Grover <joeygrover@gmail.com> | 2016-06-21 16:20:21 -0400 |
commit | 16a3d5741d1fa27c4de657a025cd1ce5cd17aec0 (patch) | |
tree | 3b39193d1d9dfa9de15ef116ff64cf131219bd25 | |
parent | 8915c8322d05142ff740112f58eb8f05bd29aec5 (diff) | |
download | sdl_android-bugfix/issue_303.tar.gz |
Fixes #303bugfix/issue_303
Added a check for null on the passed in context into SdlBroadcastReceiver.
-rw-r--r-- | sdl_android_lib/src/com/smartdevicelink/transport/SdlBroadcastReceiver.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sdl_android_lib/src/com/smartdevicelink/transport/SdlBroadcastReceiver.java b/sdl_android_lib/src/com/smartdevicelink/transport/SdlBroadcastReceiver.java index 70589bc4a..728150627 100644 --- a/sdl_android_lib/src/com/smartdevicelink/transport/SdlBroadcastReceiver.java +++ b/sdl_android_lib/src/com/smartdevicelink/transport/SdlBroadcastReceiver.java @@ -198,11 +198,14 @@ public abstract class SdlBroadcastReceiver extends BroadcastReceiver{ /** * If a Router Service is running, this method determines if that service is connected to a device over some form of transport. - * @param context A context to access Android system services through. + * @param context A context to access Android system services through. If null is passed, this will always return false * @return True if a transport connection is established, false otherwise. */ public static boolean isTransportConnected(Context context){ Log.d(TAG, "Checking to see if router service is transport connected"); + if(context == null){ + return false; + } if(isRouterServiceRunning(context,false)){ //So there is a service up, let's see if it's connected Context con; try { |