Skip to content

Commit 261acbc

Browse files
authored
fix(authentication-client): Do not trigger storage methods if storage not defined (#3210)
1 parent b8e2769 commit 261acbc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/authentication-client/src/storage.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ export class StorageWrapper implements Storage {
3636
}
3737

3838
getItem(key: string) {
39-
return Promise.resolve(this.storage.getItem(key))
39+
return Promise.resolve(this.storage?.getItem(key))
4040
}
4141

4242
setItem(key: string, value: any) {
43-
return Promise.resolve(this.storage.setItem(key, value))
43+
return Promise.resolve(this.storage?.setItem(key, value))
4444
}
4545

4646
removeItem(key: string) {

0 commit comments

Comments
 (0)