fix(service): Fix crash if a sign out happened

This commit is contained in:
PapaTutuWawa 2022-11-16 14:28:56 +01:00
parent 72501bd0b3
commit f0e68f7b48

View File

@ -37,9 +37,11 @@ class XmppState with _$XmppState {
factory XmppState.fromDatabaseTuples(Map<String, String?> tuples) {
final smStateString = tuples['smState'];
final isSmStateNotNull = smStateString != null && smStateString != 'null';
final json = <String, dynamic>{
'smState': smStateString != null ? jsonDecode(smStateString) as Map<String, dynamic> : null,
'smState': isSmStateNotNull ?
jsonDecode(smStateString) as Map<String, dynamic> :
null,
'srid': tuples['srid'],
'resource': tuples['resource'],
'jid': tuples['jid'],