From 6d7e0e702599b5751a8ca8939f471766228ec5b2 Mon Sep 17 00:00:00 2001 From: Calixte Denizet Date: Fri, 18 Jul 2025 16:51:24 +0200 Subject: [PATCH] [Editor] Only add a popup to an existing annotation if it exits It fixes the ink integration test "must update an existing annotation". --- src/display/annotation_layer.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/display/annotation_layer.js b/src/display/annotation_layer.js index f40bf02d1..b28d11f18 100644 --- a/src/display/annotation_layer.js +++ b/src/display/annotation_layer.js @@ -215,7 +215,7 @@ class AnnotationElement { } let popup = this.#popupElement?.popup || this.popup; - if (!popup && newPopup.text) { + if (!popup && newPopup?.text) { this._createPopup(newPopup); popup = this.#popupElement.popup; } @@ -223,7 +223,7 @@ class AnnotationElement { return; } popup.updateEdited(params); - if (newPopup.deleted) { + if (newPopup?.deleted) { popup.remove(); this.#popupElement = null; this.popup = null;