From 26ab449aa0a619c5398d80cc6ac616f28647039d Mon Sep 17 00:00:00 2001 From: Scott Jackson Date: Sat, 31 Jan 2015 13:59:06 -0800 Subject: Fix crash if cancel reason or response is null --- src/github/daneren2005/dsub/service/DLNAController.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/github') diff --git a/src/github/daneren2005/dsub/service/DLNAController.java b/src/github/daneren2005/dsub/service/DLNAController.java index 6a620542..cdff990b 100644 --- a/src/github/daneren2005/dsub/service/DLNAController.java +++ b/src/github/daneren2005/dsub/service/DLNAController.java @@ -124,9 +124,13 @@ public class DLNAController extends RemoteController { @Override protected void ended(GENASubscription genaSubscription, CancelReason cancelReason, UpnpResponse upnpResponse) { Log.i(TAG, "Ended subscription"); - Log.i(TAG, "Cancel Reason: " + cancelReason.toString()); - Log.i(TAG, "Reponse Message: " + upnpResponse.getStatusMessage()); - Log.i(TAG, "Response Details: " + upnpResponse.getResponseDetails()); + if(cancelReason != null) { + Log.i(TAG, "Cancel Reason: " + cancelReason.toString()); + } + if(upnpResponse != null) { + Log.i(TAG, "Reponse Message: " + upnpResponse.getStatusMessage()); + Log.i(TAG, "Response Details: " + upnpResponse.getResponseDetails()); + } } @Override -- cgit v1.2.3