Android Question B4XSerializator returns null in the event handling procedure, for the asynchronous method

Darsiar

Member
B4XSerializator returns null in the event handling procedure, for the asynchronous method:
ser.ConvertBytesToObjectAsync (Bit.InputStreamToBytes (job.GetInputStream), "meet") ---->


B4X:
Private Sub enro_BytesToObject (Success As Boolean, NewObject As Object)

    Dim m As Map = NewObject
    If Success And m<> Null Then   
  
      If m.Get("taskname") ="" Then ' регистрация не доступна
        ' выдать сообщение обошибке
        MsgboxAsync("Ошибка регистрации","")
      
        ........
    end if
end if

end sub

Error message:
java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.Object.equals(java.lang.Object)' on a null object reference


However, if you put an interrupt in the input of this method in the debugger, then in a step-by-step mode everything works fine (there is a value)
 
Last edited:

Darsiar

Member
Many thanks.
We found the reason, it was in a wi-fi connection that did not send data correctly.
However, anyway, there is an interesting effect in the debugger.
Quite often, the debugger shows Zero in the object when it is there, and everything works in steps correctly.

In other cases, it happens when, due to the failure of the Network, zero came, it runs correctly in the debugger, as if it weren’t zero.

But this does not interfere.
We fixed our code in another module.
Many thanks.
 
Upvote 0
Top