Skip to content

Commit dc9e18f

Browse files
committed
fix: Ensure data validation in handleSave for CoordinateNote and NewCoordinateNotes components
1 parent d7160f6 commit dc9e18f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/screens/CoordinateNotes/CoordinateNote.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export default function CoordinateNote({ navigation, route }: CoordinateNoteProp
3737
const deleteNote = coordinateNotesStore((state) => state.deleteNote)
3838

3939
const handleSave = useCallback(() => {
40-
if (!name || name.trim().length === 0) return
40+
if (!name || name.trim().length === 0 || !data) return
4141
updateNote({
4242
title: name.trim(),
4343
description: description.trim(),

src/screens/CoordinateNotes/NewCoordinateNotes.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export default function NewCoordinateNotes({ navigation }: NavProp) {
2626
})
2727

2828
const handleSave = useCallback(() => {
29-
if (!name || name.trim().length === 0) return
29+
if (!name || name.trim().length === 0 || !data) return
3030
updateNote({
3131
title: name.trim(),
3232
description: description.trim(),

0 commit comments

Comments
 (0)