Skip to content

Commit

Permalink
tweak creds handling (#79)
Browse files Browse the repository at this point in the history
  • Loading branch information
bmingles committed Oct 8, 2024
1 parent 61a5e33 commit 483b5a8
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/services/DheService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,18 @@ export class DheService implements IDheService {
REQUEST_DHE_USER_CREDENTIALS_CMD,
this.serverUrl
);
}

const dheCredentials = this._dheCredentialsCache.get(this.serverUrl);
if (dheCredentials == null) {
logger.error('Failed to get DHE credentials for server:', this.serverUrl);
return null;
if (!this._dheCredentialsCache.has(this.serverUrl)) {
logger.error(
'Failed to get DHE credentials for server:',
this.serverUrl
);
return null;
}
}

const dheCredentials = this._dheCredentialsCache.get(this.serverUrl)!;

try {
await dheClient.login(dheCredentials);
} catch (err) {
Expand Down

0 comments on commit 483b5a8

Please sign in to comment.