From 6722ede7701ca51122a6c23b47e39aad98d7e57a Mon Sep 17 00:00:00 2001 From: Evan Hahn Date: Tue, 19 Nov 2024 15:38:04 +0000 Subject: [PATCH] Fix missing core ownership in some cases --- src/roles.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/roles.js b/src/roles.js index 8df89781..7bd788c2 100644 --- a/src/roles.js +++ b/src/roles.js @@ -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)