Skip to content

Commit 5e43726

Browse files
committed
Guard useSavedIdentity against empty identity list
The SavedIdentity refactor changed useSavedIdentity to read from an array, but getSavedIdentity returns undefined when no identity was saved. This crashed CountItems which calls useSavedIdentity via 'the operation finished without error' without prior identity setup. Match old behavior by returning early when no identity exists. Issue: ZENKO-5202
1 parent 10e02f8 commit 5e43726

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

tests/ctst/world/Zenko.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -792,6 +792,9 @@ export default class Zenko extends World<ZenkoWorldParameters> {
792792

793793
useSavedIdentity() {
794794
const last = this.getSavedIdentity();
795+
if (!last) {
796+
return;
797+
}
795798
Identity.useIdentity(last.identityType, last.identityName, last.accountName);
796799
}
797800

0 commit comments

Comments
 (0)