Skip to content

Commit 8e0b339

Browse files
committed
fixed sonar issue
1 parent 86619b7 commit 8e0b339

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/containers/my-cooperations/cooperation-notes/CooperationNotes.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,11 @@ const CooperationNotes: React.FC = () => {
145145
const duplicateNote = (noteId: string) => {
146146
const note = notes?.find((item) => item._id === noteId)
147147

148-
return CooperationNotesService.createNote(note!, cooperationId)
148+
if (!note) {
149+
throw new Error('Note with specified ID was not found')
150+
}
151+
152+
return CooperationNotesService.createNote(note, cooperationId)
149153
}
150154

151155
const { mutate: duplicateItem } = useMutation({

0 commit comments

Comments
 (0)