diff --git a/lib/ui/routes/conversation_route.dart b/lib/ui/routes/conversation_route.dart index cc084d4..9914330 100644 --- a/lib/ui/routes/conversation_route.dart +++ b/lib/ui/routes/conversation_route.dart @@ -44,9 +44,12 @@ class _ConversationRouteState extends State { if (_conversation == null) return setError(true); + final conversationName = await ConversationsHelper.getConversationNameAsync(_conversation); + if(!this.mounted) return null; + if (conversationName == null) return setError(true); setState(() { diff --git a/lib/ui/screens/conversations_list_screen.dart b/lib/ui/screens/conversations_list_screen.dart index a933194..ee21611 100644 --- a/lib/ui/screens/conversations_list_screen.dart +++ b/lib/ui/screens/conversations_list_screen.dart @@ -33,6 +33,12 @@ class _ConversationScreenState extends State { _loadConversations(); } + @override + void setState(fn) { + if(mounted) + super.setState(fn); + } + void setError(LoadErrorLevel err) => setState(() => _error = err); void setLoading(bool loading) => setState(() => _loading = loading); @@ -64,8 +70,10 @@ class _ConversationScreenState extends State { //Get information about the members of the conversations list.users = await _usersHelper.getUsersInfo(list.allUsersID); + if (list.users == null) return _gotLoadingError(); + //Save list setState(() { _list = list;