diff --git a/DysonNetwork.Sphere/Post/PostService.cs b/DysonNetwork.Sphere/Post/PostService.cs index 7cd430e..3d34168 100644 --- a/DysonNetwork.Sphere/Post/PostService.cs +++ b/DysonNetwork.Sphere/Post/PostService.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.RegularExpressions; using AngleSharp.Common; using DysonNetwork.Shared; @@ -667,8 +668,14 @@ public partial class PostService( if (!post.Meta!.TryGetValue("embeds", out var value)) return; - var embeds = (List>)value; - + var embeds = value switch + { + JsonElement e => e.Deserialize>>(), + _ => null + }; + if (embeds is null) + return; + // Find the index of the poll embed first var pollIndex = embeds.FindIndex(e => e.ContainsKey("type") && (string)e["type"] == "poll");