Skip to content

Commit 1bb3970

Browse files
committed
fix(#101): SSG 빌드 시 undefined 전달 방지
1 parent 134cd8b commit 1bb3970

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/app/story/register/_components/StoryImagePreview/StoryImagePreview.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export const StoryImagePreview = () => {
1010
const { watch, setValue } = useFormContext<StoryRegisterFormData>();
1111
const imageFile = watch("image");
1212

13-
const previewUrl = URL.createObjectURL(imageFile);
13+
const previewUrl = imageFile && URL.createObjectURL(imageFile);
1414

1515
const validateImage = (file: File) => {
1616
const result = imageFileSchema.safeParse(file);

0 commit comments

Comments
 (0)