-
Notifications
You must be signed in to change notification settings - Fork 46
Open
Description
Possible NullPointerException (Most serious bug) in the file Chat activity.Java
In:
void sendMessageToUser(String message){
chatroomModel.setLastMessageTimestamp(Timestamp.now());
chatroomModel might be null because:
getOrCreateChatroomModel() runs asynchronously
User may click send before Firebase finishes loading
Fix
Add a null check:
if(chatroomModel == null){
Log.e("ChatActivity","Chatroom not initialized yet");
return;
}
OR disable send button until chatroom loads.
Hope this small contribution may help in creating an amazing application 🤩
Thanku
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels