From 7c81fc6bac322bbb695884debc0bc67772391d3a Mon Sep 17 00:00:00 2001 From: "Joshua A. Horton" Date: Fri, 6 Oct 2023 11:41:11 +0700 Subject: [PATCH] fix(web): null-guard for a new property --- .../engine/headless/gestures/matchers/gestureSequence.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/common/web/gesture-recognizer/src/engine/headless/gestures/matchers/gestureSequence.ts b/common/web/gesture-recognizer/src/engine/headless/gestures/matchers/gestureSequence.ts index 0654a600961..6838647cb96 100644 --- a/common/web/gesture-recognizer/src/engine/headless/gestures/matchers/gestureSequence.ts +++ b/common/web/gesture-recognizer/src/engine/headless/gestures/matchers/gestureSequence.ts @@ -142,6 +142,12 @@ export class GestureSequence extends EventEmitter> { * current state. They will be specified in descending `resolutionPriority` order. */ public get potentialModelMatchIds(): string[] { + // If `this.selector` is null, it's because no further matches are possible. + // We've already emitted the 'complete' event as well. + if(!this.selector) { + return []; + } + // The new round of model-matching is based on the sources used by the previous round. // This is important; 'sustainTimer' gesture models may rely on a now-terminated source // from that previous round (like with multitaps).