Skip to content

Commit

Permalink
fix: (user:psl:assign) catch err if failed to get AssigneeId
Browse files Browse the repository at this point in the history
  • Loading branch information
cristiand391 committed May 17, 2022
1 parent 94ed72d commit e6075f7
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/commands/force/user/permsetlicense/assign.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,13 @@ export class UserPermsetLicenseAssignCommand extends SfdxCommand {
// Convert any aliases to usernames
const resolvedUsername = (await GlobalInfo.getInstance()).aliases.resolveUsername(usernameOrAlias);

const AssigneeId = (
await this.org
.getConnection()
.singleRecordQuery<{ Id: string }>(`select Id from User where Username = '${resolvedUsername}'`)
).Id;

try {
const AssigneeId = (
await this.org
.getConnection()
.singleRecordQuery<{ Id: string }>(`select Id from User where Username = '${resolvedUsername}'`)
).Id;

await this.org.getConnection().sobject('PermissionSetLicenseAssign').create({
AssigneeId,
PermissionSetLicenseId: this.pslId,
Expand Down

0 comments on commit e6075f7

Please sign in to comment.