🐛 fix(chatMessage/index.tsx): add optional chaining to template.split() to handle cases where template is null or undefined
This commit is contained in:
parent
b1a58a76b8
commit
7dcaf709da
1 changed files with 1 additions and 1 deletions
|
|
@ -147,7 +147,7 @@ export default function ChatMessage({
|
|||
</button>
|
||||
<span className="prose inline-block break-words text-primary dark:prose-invert">
|
||||
{promptOpen
|
||||
? template.split("\n").map((line, index) => {
|
||||
? template?.split("\n")?.map((line, index) => {
|
||||
const regex = /{([^}]+)}/g;
|
||||
let match;
|
||||
let parts = [];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue