diff --git a/crates/ruma-client-api/src/sync/sync_events/v4.rs b/crates/ruma-client-api/src/sync/sync_events/v4.rs index 843deb4279..3d3fc91e56 100644 --- a/crates/ruma-client-api/src/sync/sync_events/v4.rs +++ b/crates/ruma-client-api/src/sync/sync_events/v4.rs @@ -7,6 +7,7 @@ use std::{collections::BTreeMap, time::Duration}; use js_int::UInt; +use js_option::JsOption; use ruma_common::{ api::{request, response, Metadata}, metadata, @@ -421,8 +422,8 @@ pub struct SlidingSyncRoom { pub name: Option, /// The avatar of the room. - #[serde(skip_serializing_if = "Option::is_none")] - pub avatar: Option, + #[serde(default, skip_serializing_if = "JsOption::is_undefined")] + pub avatar: JsOption, /// Was this an initial response. #[serde(skip_serializing_if = "Option::is_none")]