voice icon indicating copy to clipboard operation
voice copied to clipboard

add null check to onResult callback

Open Cnilton opened this issue 2 years ago • 6 comments

PR to fix android crashing on result being null:

E FATAL EXCEPTION: main Process: com.poc_speech_recognigtion, PID: 11881 java.lang.NullPointerException: Attempt to invoke virtual method 'java.util.Iterator java.util.ArrayList.iterator()' on a null object reference at com.wenkesj.voice.VoiceModule.onResults(VoiceModule.java:354) at android.speech.SpeechRecognizer$InternalRecognitionListener$1.handleMessage(SpeechRecognizer.java:1062) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loopOnce(Looper.java:230) at android.os.Looper.loop(Looper.java:319) at android.app.ActivityThread.main(ActivityThread.java:8893) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:608) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1103)

Cnilton avatar May 01 '24 03:05 Cnilton

+1

hemant-bansal-os avatar May 08 '24 16:05 hemant-bansal-os

+1

fturkyilmaz avatar Jul 21 '24 19:07 fturkyilmaz

+1

federicomrossi avatar Aug 01 '24 11:08 federicomrossi

+1

scampa avatar Aug 01 '24 11:08 scampa

Hi @lortmorris, these changes were approved last month, is there anything else needed for this to be merged?

Cnilton avatar Aug 06 '24 17:08 Cnilton

+1

raulburigo avatar Aug 16 '24 17:08 raulburigo

Has this bug been fixed? I still have this bug on version 3.2.4

"@react-native-voice/voice": "3.2.4", "react": "18.2.0", "react-native": "0.71.2"

lehuytruyen98-hue avatar Oct 12 '25 04:10 lehuytruyen98-hue

Hi @Johan-dutoit, I see that the Project has been updated on Master branch, and this file on this PR doesn't even exist anymore. Can you please make sure this fix is done on the new code?

Cnilton avatar Oct 12 '25 13:10 Cnilton