Compare commits

...

1 Commits

Author SHA1 Message Date
Cursor Agent
587b4a8924 Fix TypeError: Cannot read properties of null (reading 'finished')
Add null check for response before accessing finished property in PUT endpoint.
When getResponse returns null (response not found), return 404 instead of
attempting to access properties on null object.

Fixes FORMBRICKS-FN
2026-02-03 16:55:34 +00:00

View File

@@ -71,6 +71,12 @@ export const PUT = withV1ApiWrapper({
};
}
if (!response) {
return {
response: responses.notFoundResponse("Response", responseId, true),
};
}
if (response.finished) {
return {
response: responses.badRequestResponse("Response is already finished", undefined, true),