File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
crates/matrix-sdk-base/src/response_processors Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -178,12 +178,18 @@ pub mod sync {
178
178
Some ( result) => result,
179
179
} ;
180
180
181
- let inner = & room_event
181
+ let inner = match room_event
182
182
. event
183
183
// TODO: UNSAFE CAST - someone evil could encrypt something that
184
184
// isn't a state event.
185
185
. deserialize_as_unchecked :: < AnySyncStateEvent > ( )
186
- . unwrap ( ) ;
186
+ {
187
+ Ok ( inner) => inner,
188
+ Err ( e) => {
189
+ warn ! ( "Malformed event body: {e}" ) ;
190
+ continue ;
191
+ }
192
+ } ;
187
193
188
194
// Check event types match, discard if not.
189
195
let inner_event_type = inner. event_type ( ) . to_string ( ) ;
@@ -208,7 +214,7 @@ pub mod sync {
208
214
continue ;
209
215
}
210
216
211
- room_info. handle_state_event ( inner) ;
217
+ room_info. handle_state_event ( & inner) ;
212
218
}
213
219
}
214
220
}
You can’t perform that action at this time.
0 commit comments