Skip to content

Commit

Permalink
fix: answer이 null일 경우 예외 처리
Browse files Browse the repository at this point in the history
  • Loading branch information
gogumalatte committed Dec 2, 2024
1 parent 551628b commit 1b23191
Show file tree
Hide file tree
Showing 2 changed files with 242 additions and 128 deletions.
4 changes: 3 additions & 1 deletion src/pages/MainPage/GuestPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ const GuestPage = () => {

const cleanText = (text: string) => text.replace(/^\s+|\s+$/g, ""); // 공백 및 줄바꿈 제거

const formattedResponse = `${cleanText(data.answer)}
const formattedResponse = `${
data.answer ? cleanText(data.answer) : ""
} <!-- null일 경우 제거 -->
${
data.images?.length && data.images[0] !== "No content"
? data.images
Expand Down
Loading

0 comments on commit 1b23191

Please sign in to comment.