File tree 1 file changed +8
-1
lines changed
packages/stream_chat/lib/src/core/api
1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import 'package:stream_chat/src/core/models/channel_state.dart';
8
8
import 'package:stream_chat/src/core/models/event.dart' ;
9
9
import 'package:stream_chat/src/core/models/filter.dart' ;
10
10
import 'package:stream_chat/src/core/models/message.dart' ;
11
+ import 'package:flutter/foundation.dart' ;
11
12
12
13
/// Defines the api dedicated to channel operations
13
14
class ChannelApi {
@@ -79,7 +80,13 @@ class ChannelApi {
79
80
}),
80
81
},
81
82
);
82
- return QueryChannelsResponse .fromJson (response.data);
83
+
84
+ try {
85
+ return QueryChannelsResponse .fromJson (jsonDecode (response.data));
86
+ } catch (e) {
87
+ debugPrint ('queryChannels error: $e ' );
88
+ return QueryChannelsResponse .fromJson ({});
89
+ }
83
90
}
84
91
85
92
/// Mark all channels for this user as read
You can’t perform that action at this time.
0 commit comments