Grohiik / Meddelandesystem

Gruppuppgift trådar och datakomunication
MIT License
1 stars 0 forks source link

Unsent Messages does not work when coming online #11

Closed mnerv closed 3 years ago

mnerv commented 3 years ago

UnsentMessage is null

When sending to a user that's offline, then reconnect that user the message does not arrive and the error below appeared. This is tested on the branch serverController on commit 27205449db5c978f6ec1306e7b93efcfca9f1f2a with client-side on commit 0538135cba1e77a85b4e871f6110f5add8f684e1

Enter start date: Exception in thread "Thread-29" java.lang.NullPointerException: Cannot invoke "java.util.ArrayList.iterator()" because "currentUnsentMessages" is null
        at server.control.ServerController$MessageListener.run(ServerController.java:217)

The error does not appear if the server has been restarted and both were online from the start. But when added to the friend list and trying to send it when they are offline and reconnect, the error will appear. The reconnected user might not be connected properly too.

Enter start date: Exception in thread "Thread-7" java.lang.NullPointerException: Cannot invoke "java.util.ArrayList.iterator()" because "currentUnsentMessages" is null
        at server.control.ServerController$MessageListener.run(ServerController.java:217)
Exception in thread "Thread-13" java.lang.NullPointerException: Cannot invoke "java.util.ArrayList.iterator()" because "currentUnsentMessages" is null
        at server.control.ServerController$MessageListener.run(ServerController.java:217)
MrMackan commented 3 years ago

sorted at 3c656b15611afd028a79075855e3989ce0923bc7