adventures-in / chat_app

A group effort to build a chat app and learn as we go.
18 stars 0 forks source link

Error when no messages exists within a conversation #208

Closed gaslitbytech closed 4 years ago

gaslitbytech commented 4 years ago

Got the following error on a conversations with no messages.

Exception has occurred.
StateError (Bad state: No element)
Screen Shot 2020-07-05 at 8 18 24 pm

One possible solution is to not init prematurely and instead change the algorithm so it the first message will pick up as the first. In python I'd init the algorithm to start with datetime.min() which is the first possible value of a datetime.