Prevent NPE

This commit is contained in:
str4d
2014-12-10 12:16:48 +00:00
parent 084a03e70c
commit 5d548b7bac
2 changed files with 7 additions and 4 deletions

View File

@@ -90,10 +90,12 @@ public class BoteService extends Service implements NetworkStatusListener, NewEm
@Override
public void onDestroy() {
if (mTriedBindState) {
try {
mStateService.unregisterCallback(mStatusListener);
} catch (RemoteException e) {}
if (mTriedBindState && mStateConnection != null) {
if (mStateService != null) {
try {
mStateService.unregisterCallback(mStatusListener);
} catch (RemoteException e) {}
}
unbindService(mStateConnection);
}
mTriedBindState = false;