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

@@ -1,5 +1,6 @@
0.3.1
* Fixed crash when clicking "Create new contact" button
* Fixed occasional crash when Bote disconnects from network
* Added labels to the address book actions menu
0.3 / 2014-12-01 / ebba8aac78d50eda9d25f936e8bd348553966649

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;