Android Question FCM sub fm_messagearrived >>error>> null object string to real

scsjc

Well-Known Member
Licensed User
Longtime User
Hello...
i don't know why... sometimes have error on fm_messagearrived.... (null object refernce.... stringtoreal.parsedouble....???)

i'm try:
B4X:
Sub fm_MessageArrived (Message As RemoteMessage)
    If Not(Message.IsInitialized) Or Message.GetData = Null Or codigo.Nz(Message.GetData,"") = "" Then Return
    Log($"Message data: ${Message.GetData}"$)

the errors:
B4X:
java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String java.lang.String.trim()' on a null object reference
at java.lang.StringToReal.parseDouble(StringToReal.java:263)
at java.lang.Double.parseDouble(Double.java:301)
at myworldapp.wow.com.firebasemessaging._fm_messagearrived(firebasemessaging.java:335)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:169)
at anywheresoftware.b4a.BA$1.run(BA.java:293)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:158)
at android.app.ActivityThread.main(ActivityThread.java:7229)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
 

scsjc

Well-Known Member
Licensed User
Longtime User
What is the output of Log(Message) ?

Where is the code that converts a string to a number? It is not in the code you posted.
Sorry for question...i'm mistake.... i need a hollidays !!!! :)

thanks !!!
 
Upvote 0
Top