Error NPE when send message

Hi,

I got error NullPointerException when try to send message. I use Sendbird version 3.0.156.

Here is the stacktrace:

Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String com.sendbird.android.j1.f()' on a null object reference
   at com.happyfresh.happychat.ChatUser.<init>(ChatUser.java:20)
   at com.happyfresh.happychat.ChatMessage.setBaseMessage(ChatMessage.java:161)
   at com.happyfresh.happychat.ChatViewModel.sendMessage(ChatViewModel.java:398)
   at com.happyfresh.happychat.ChatFragment.lambda$onViewCreated$10(ChatFragment.java:225)
   at com.happyfresh.happychat.ChatFragment.lambda$onViewCreated$10$ChatFragment(ChatFragment.java)
   at com.happyfresh.happychat.-$$Lambda$ChatFragment$xx5VIYsa6-fWBmGhiuJkYgu73Mw.onSubmit(-.java:2)
   at com.happyfresh.happychat.widget.MessageInput.onSubmit(MessageInput.java:182)
   at com.happyfresh.happychat.widget.MessageInput.onClick(MessageInput.java:125)
   at android.view.View.performClick(View.java:6642)
   at android.view.View.performClickInternal(View.java:6619)
   at android.view.View.access$3100(View.java:790)
   at android.view.View$PerformClick.run(View.java:26189)
   at android.os.Handler.handleCallback(Handler.java:873)
   at android.os.Handler.dispatchMessage(Handler.java:99)
   at android.os.Looper.loop(Looper.java:224)
   at android.app.ActivityThread.main(ActivityThread.java:7147)
   at java.lang.reflect.Method.invoke(Method.java)
   at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:511)
   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:876)

Any suggestion how to fix the problem?
Thanks

Hi, @razibkani Could you give me the code snippet so that I can know what code I’m accessing?