diff --git a/src/workspaces/officerdev/src/apps/Chat/components/MessageBubble.tsx b/src/workspaces/officerdev/src/apps/Chat/components/MessageBubble.tsx
index c0b7bbd6..bb3f8857 100644
--- a/src/workspaces/officerdev/src/apps/Chat/components/MessageBubble.tsx
+++ b/src/workspaces/officerdev/src/apps/Chat/components/MessageBubble.tsx
@@ -99,9 +99,10 @@ type MessageBubbleProps = {
export const MessageBubble = ({ message, onAnswer }: MessageBubbleProps) => {
switch (message.role) {
case 'user': {
- const match = message.text.match(FRONTMATTER_RE);
+ const rawText = typeof message.text === 'string' ? message.text : '';
+ const match = rawText.match(FRONTMATTER_RE);
const metadata = match ? match[1]!.trim() : null;
- const text = match ? message.text.slice(match[0]!.length) : message.text;
+ const text = match ? rawText.slice(match[0]!.length) : rawText;
return (
<>
{metadata &&