Skip to content

Commit 98f25f1

Browse files
authored
fix: LDP-1747: Prevent typeerror when context.res is undefined. (#86)
1 parent 98458ad commit 98f25f1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/plugin.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const pageErrorHandler = (error, commit, context, options) => {
2323
if (!options.customErrorPages && error.response.data && error.response.data.title && error.response.data.content) {
2424
error.response.data.statusCode = error.response.status
2525
// Set the statusCode for the error
26-
if (process.server && context.res.statusCode) {
26+
if (process.server && context?.res?.statusCode) {
2727
context.res.statusCode = error.response.data.statusCode
2828
}
2929
commit('page', error.response.data)

0 commit comments

Comments
 (0)