From 9ea628b9128b53145101beb16ea6d525c67c648d Mon Sep 17 00:00:00 2001 From: danielpeintner Date: Mon, 25 Sep 2023 13:59:31 +0200 Subject: [PATCH] Update packages/core/src/consumed-thing.ts Co-authored-by: Jan Romann --- packages/core/src/consumed-thing.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/core/src/consumed-thing.ts b/packages/core/src/consumed-thing.ts index da88b7b58..8161dc188 100644 --- a/packages/core/src/consumed-thing.ts +++ b/packages/core/src/consumed-thing.ts @@ -169,9 +169,7 @@ class InternalPropertySubscription extends InternalSubscription { if (tp == null) { throw new Error(`ConsumedThing '${this.thing.title}' does not have property ${this.name}`); } - if (options.formIndex == null) { - options.formIndex = this.matchingUnsubscribeForm(); - } + options.formIndex ??= this.matchingUnsubscribeForm(); const { form } = this.thing.getClientFor(tp.forms, "unobserveproperty", Affordance.PropertyAffordance, options); if (form == null) { throw new Error(`ConsumedThing '${this.thing.title}' did not get suitable form`);