aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/cgeo/geocaching/speech
diff options
context:
space:
mode:
authorSamuel Tardieu <sam@rfc1149.net>2014-04-02 13:14:03 +0200
committerSamuel Tardieu <sam@rfc1149.net>2014-04-02 13:14:03 +0200
commit8b8dc680031797c0d924ea2cc272745731d627fb (patch)
tree790f3e4382f941a458b83b665ba4092e9d5aa738 /main/src/cgeo/geocaching/speech
parenta045c6edaebe4200835aeffcea977fc8245b6ad1 (diff)
downloadcgeo-8b8dc680031797c0d924ea2cc272745731d627fb.zip
cgeo-8b8dc680031797c0d924ea2cc272745731d627fb.tar.gz
cgeo-8b8dc680031797c0d924ea2cc272745731d627fb.tar.bz2
fix #3722: NPE in SpeechService
It looks like `onDestroy` might be called before completion of `onInit`.
Diffstat (limited to 'main/src/cgeo/geocaching/speech')
-rw-r--r--main/src/cgeo/geocaching/speech/SpeechService.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/main/src/cgeo/geocaching/speech/SpeechService.java b/main/src/cgeo/geocaching/speech/SpeechService.java
index 5cf732c..681c449 100644
--- a/main/src/cgeo/geocaching/speech/SpeechService.java
+++ b/main/src/cgeo/geocaching/speech/SpeechService.java
@@ -18,6 +18,7 @@ import android.os.IBinder;
import android.speech.tts.TextToSpeech;
import android.speech.tts.TextToSpeech.Engine;
import android.speech.tts.TextToSpeech.OnInitListener;
+import rx.subscriptions.Subscriptions;
import java.util.Locale;
@@ -76,7 +77,7 @@ public class SpeechService extends Service implements OnInitListener {
private long lastSpeechTime = 0;
private float lastSpeechDistance = 0.0f;
private Geopoint target;
- private Subscription initSubscription;
+ private Subscription initSubscription = Subscriptions.empty();
@Override
public IBinder onBind(Intent intent) {