Skip to content

Commit

Permalink
Fix NPE when error.response is null. (#102)
Browse files Browse the repository at this point in the history
* Add NPE checks in error response objects

* Fix Operator
  • Loading branch information
rithick-ctds authored Jan 20, 2025
1 parent ff5282c commit 98f59e2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion server/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,8 @@ const onProxyRes = (proxyRes, req, res) => {
res.status(resp.status).send(resp.data)
}).catch((error) => {
console.error(error)
res.status(error.response.status).send(error.response.data)
res.status(error?.response?.status || 500)
.send(error?.response?.data || 'Internal Server Error')
})
} else {
res.statusCode = proxyRes.statusCode;
Expand Down

0 comments on commit 98f59e2

Please sign in to comment.