Skip to content

Commit 12d565d

Browse files
committed
chore: use type narrowing around nested object access
1 parent 7fd076b commit 12d565d

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

client-vms/src/vm/builder.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -196,10 +196,7 @@ export class VmClientBuilder {
196196
}
197197
}
198198

199-
if (
200-
!leaderClusterInfo.publicKeys ||
201-
!leaderClusterInfo.publicKeys.authentication
202-
)
199+
if (!leaderClusterInfo.publicKeys?.authentication)
203200
throw new Error("Leader public key not in cluster details");
204201

205202
const user_id = UserId.from(tokenAuthManager.publicKey);
@@ -209,7 +206,7 @@ export class VmClientBuilder {
209206
.id(user_id)
210207
.signer(signer)
211208
.leader(leader.transport)
212-
.leaderPublicKey(leaderClusterInfo.publicKeys?.authentication)
209+
.leaderPublicKey(leaderClusterInfo.publicKeys.authentication)
213210
.build();
214211

215212
const config = VmClientConfig.parse({

0 commit comments

Comments
 (0)