From e983037d9bffced960172934a561b8a11a5e4f6d Mon Sep 17 00:00:00 2001 From: Adam Date: Sat, 7 May 2016 11:37:54 +0200 Subject: [PATCH] Fixed NullPointerException when stopping Collector. --- .../info/zamojski/soft/towercollector/CollectorService.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/info/zamojski/soft/towercollector/CollectorService.java b/app/src/main/java/info/zamojski/soft/towercollector/CollectorService.java index 5164907a..9bbe5437 100644 --- a/app/src/main/java/info/zamojski/soft/towercollector/CollectorService.java +++ b/app/src/main/java/info/zamojski/soft/towercollector/CollectorService.java @@ -225,7 +225,9 @@ public void onDestroy() { periodicalPhoneStateListener.cancel(); } measurementParser.stop(); - externalIntentBroadcaster.stop(); + if (externalIntentBroadcaster != null) { + externalIntentBroadcaster.stop(); + } EventBus.getDefault().postSticky(new GpsStatusChangedEvent()); EventBus.getDefault().unregister(this); if (stopRequestBroadcastReceiver != null)