diff --git a/src/plugins/typingTweaks/index.tsx b/src/plugins/typingTweaks/index.tsx
index 4fb3c7757..e2bbb4bc9 100644
--- a/src/plugins/typingTweaks/index.tsx
+++ b/src/plugins/typingTweaks/index.tsx
@@ -129,14 +129,22 @@ export default definePlugin({
buildSeveralUsers,
mutateChildren(props: any, users: User[], children: any) {
- if (!Array.isArray(children)) return children;
+ try {
+ if (!Array.isArray(children)) {
+ return children;
+ }
- let element = 0;
+ let element = 0;
- return children.map(c =>
- c.type === "strong"
- ?
- : c
- );
+ return children.map(c =>
+ c.type === "strong" || (typeof c !== "string" && !React.isValidElement(c))
+ ?
+ : c
+ );
+ } catch (e) {
+ console.error(e);
+ }
+
+ return children;
}
});