diff --git a/packages/oidc-client/src/initWorker.ts b/packages/oidc-client/src/initWorker.ts index cbefd282d..ff6e89b48 100644 --- a/packages/oidc-client/src/initWorker.ts +++ b/packages/oidc-client/src/initWorker.ts @@ -63,7 +63,7 @@ const sendMessageAsync = return new Promise(function (resolve, reject) { const messageChannel = new MessageChannel(); messageChannel.port1.onmessage = function (event) { - if (event.data && event.data.error) { + if (event?.data.error) { reject(event.data.error); } else { resolve(event.data);