diff options
author | TheArcaneBrony <myrainbowdash949@gmail.com> | 2023-10-24 17:44:03 +0200 |
---|---|---|
committer | TheArcaneBrony <myrainbowdash949@gmail.com> | 2023-10-24 17:44:03 +0200 |
commit | 478fc1b0ef855530e1e93c5212d154280f9d7dd8 (patch) | |
tree | 3bb348b939f8d78e85337d49d3163ac5dbc8e8cc /LibMatrix/StateEvent.cs | |
parent | fix synchelper null check (diff) | |
download | LibMatrix-478fc1b0ef855530e1e93c5212d154280f9d7dd8.tar.xz |
Minor cleanup
Diffstat (limited to 'LibMatrix/StateEvent.cs')
-rw-r--r-- | LibMatrix/StateEvent.cs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/LibMatrix/StateEvent.cs b/LibMatrix/StateEvent.cs index fb4dd71..dbb3401 100644 --- a/LibMatrix/StateEvent.cs +++ b/LibMatrix/StateEvent.cs @@ -56,7 +56,12 @@ public class StateEvent { return null; } - set => RawContent = JsonSerializer.Deserialize<JsonObject>(JsonSerializer.Serialize(value, value.GetType())); + set { + if (value is null) { + RawContent = null; + } + else RawContent = JsonSerializer.Deserialize<JsonObject>(JsonSerializer.Serialize(value, value.GetType())); + } } [JsonPropertyName("state_key")] |