Skip to content

Commit

Permalink
Fix missing core ownership in some cases
Browse files Browse the repository at this point in the history
  • Loading branch information
EvanHahn committed Nov 19, 2024
1 parent c824e2d commit 6722ede
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/roles.js
Original file line number Diff line number Diff line change
Expand Up @@ -378,12 +378,13 @@ export class Roles extends TypedEmitter {
const assignerCore = this.#coreManager.getCoreByDiscoveryKey(
assignerCoreDiscoveryKey
)
if (assignerCore?.namespace !== 'auth') {
return null
}
if (assignerCore?.namespace !== 'auth') return null

const assignerCoreId = assignerCore.key.toString('hex')
const assignerDeviceId = await this.#coreOwnership.getOwner(assignerCoreId)
const assignerDeviceId = await this.#coreOwnership
.getOwner(assignerCoreId)
.catch(() => null)
if (!assignerDeviceId) return null

const latestRoleRecord = await this.#getRoleRecord(assignerDeviceId)

Expand Down

0 comments on commit 6722ede

Please sign in to comment.