File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed
packages/profile-sync-controller/src/controllers/authentication Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -52,11 +52,15 @@ const metadata: StateMetadata<AuthenticationControllerState> = {
5252 srpSessionData : {
5353 // Remove access token from state logs
5454 includeInStateLogs : ( srpSessionData ) => {
55- // Using non-null assertion here to assert that it's not undefined, because if it was, this
56- // wouldn't get called.
57- // The type includes `| undefined` only because we don't yet use `strictOptionalTypes`
58- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
59- return Object . entries ( srpSessionData ! ) . reduce < Record < string , Json > > (
55+ // Unreachable branch, included just to fix a type error for the case where this property is
56+ // unset. The type gets collapsed to include `| undefined` even though `undefined` is never
57+ // set here, because we don't yet use `exactOptionalPropertyTypes`.
58+ // TODO: Remove branch after enabling `exactOptionalPropertyTypes`
59+ // ref: https://github.com/MetaMask/core/issues/6565
60+ if ( srpSessionData === null || srpSessionData === undefined ) {
61+ return null ;
62+ }
63+ return Object . entries ( srpSessionData ) . reduce < Record < string , Json > > (
6064 ( sanitizedSrpSessionData , [ key , value ] ) => {
6165 const { accessToken : _unused , ...tokenWithoutAccessToken } =
6266 value . token ;
You can’t perform that action at this time.
0 commit comments