diff --git a/src/main/java/com/github/nutomic/controldlna/upnp/RemotePlayService.java b/src/main/java/com/github/nutomic/controldlna/upnp/RemotePlayService.java index 1108f33..48f187f 100644 --- a/src/main/java/com/github/nutomic/controldlna/upnp/RemotePlayService.java +++ b/src/main/java/com/github/nutomic/controldlna/upnp/RemotePlayService.java @@ -74,9 +74,9 @@ public class RemotePlayService extends Service implements RegistryListener { private static final String TAG = "RemotePlayService"; - Messenger mListener; + protected Messenger mListener; - ConcurrentHashMap> mDevices = + protected ConcurrentHashMap> mDevices = new ConcurrentHashMap>(); protected AndroidUpnpService mUpnpService; @@ -144,11 +144,15 @@ public class RemotePlayService extends Service implements RegistryListener { * Sends msg via Messenger to Provider. */ void sendMessage(Message msg) { + if (mListener == null) { + Log.w(TAG, "Listener is not initialized on send"); + } + try { mListener.send(msg); } catch (RemoteException e) { - e.printStackTrace(); + Log.w(TAG, "Failed to send message", e); } }