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 @@ -170,12 +170,18 @@ pub mod sync {
170
170
Some ( result) => result,
171
171
} ;
172
172
173
- let inner = & room_event
173
+ let inner = match room_event
174
174
. event
175
175
// TODO: UNSAFE CAST - someone evil could encrypt something that
176
176
// isn't a state event.
177
177
. deserialize_as_unchecked :: < AnySyncStateEvent > ( )
178
- . unwrap ( ) ;
178
+ {
179
+ Ok ( inner) => inner,
180
+ Err ( e) => {
181
+ warn ! ( "Malformed event body: {e}" ) ;
182
+ continue ;
183
+ }
184
+ } ;
179
185
180
186
// Check event types match, discard if not.
181
187
let inner_event_type = inner. event_type ( ) . to_string ( ) ;
@@ -200,7 +206,7 @@ pub mod sync {
200
206
continue ;
201
207
}
202
208
203
- room_info. handle_state_event ( inner) ;
209
+ room_info. handle_state_event ( & inner) ;
204
210
}
205
211
}
206
212
}
You can’t perform that action at this time.
0 commit comments