1
0
Fork 0

fixed a crash occuring sometimes when stopping voice input

This commit is contained in:
sspanak 2024-07-16 11:45:51 +03:00 committed by Dimo Karaivanov
parent d468086950
commit 96045cacc7

View file

@ -65,7 +65,7 @@ public class VoiceInputOps {
public boolean isListening() {
return listener.isListening();
return listener.isListening() && speechRecognizer != null;
}
@ -100,7 +100,7 @@ public class VoiceInputOps {
public void stop() {
this.language = null;
if (isAvailable() && listener.isListening()) {
if (isAvailable() && isListening()) {
speechRecognizer.stopListening();
}
}