summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Grover <joeygrover@gmail.com>2016-07-05 10:02:54 -0400
committerGitHub <noreply@github.com>2016-07-05 10:02:54 -0400
commit8c547967474a32ba63038030aa696180da16d684 (patch)
treea19703a3f14745e6225926abf35ac528f995f9af
parent270eb48dc1ae821854e6088e9bf0e6e31067afad (diff)
parent16a3d5741d1fa27c4de657a025cd1ce5cd17aec0 (diff)
downloadsdl_android-8c547967474a32ba63038030aa696180da16d684.tar.gz
Merge pull request #306 from smartdevicelink/bugfix/issue_303
Add null check when looking for service connection
-rw-r--r--sdl_android_lib/src/com/smartdevicelink/transport/SdlBroadcastReceiver.java5
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 {