about summary refs log tree commit diff
path: root/LibMatrix/StateEvent.cs
diff options
context:
space:
mode:
authorTheArcaneBrony <myrainbowdash949@gmail.com>2023-10-24 17:44:03 +0200
committerTheArcaneBrony <myrainbowdash949@gmail.com>2023-10-24 17:44:03 +0200
commit478fc1b0ef855530e1e93c5212d154280f9d7dd8 (patch)
tree3bb348b939f8d78e85337d49d3163ac5dbc8e8cc /LibMatrix/StateEvent.cs
parentfix synchelper null check (diff)
downloadLibMatrix-478fc1b0ef855530e1e93c5212d154280f9d7dd8.tar.xz
Minor cleanup
Diffstat (limited to 'LibMatrix/StateEvent.cs')
-rw-r--r--LibMatrix/StateEvent.cs7
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")]