We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1a91ba5 commit decac58Copy full SHA for decac58
src/content-helpers.ts
@@ -202,6 +202,9 @@ export type TopicState = {
202
203
export const parseTopicContent = (content: MRoomTopicEventContent): TopicState => {
204
const mtopic = M_TOPIC.findIn<MTopicContent>(content);
205
+ if (!Array.isArray(mtopic)) {
206
+ return { text: content.topic };
207
+ }
208
const text = mtopic?.find((r) => !isProvided(r.mimetype) || r.mimetype === "text/plain")?.body ?? content.topic;
209
const html = mtopic?.find((r) => r.mimetype === "text/html")?.body;
210
return { text, html };
0 commit comments