1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-22 16:18:08 +02:00

[Editor] Don't add an editor for empty FreeText annotations

This commit is contained in:
Calixte Denizet 2023-06-15 18:33:03 +02:00
parent 5581e22cc7
commit 1ab34d2ae4
2 changed files with 27 additions and 0 deletions

View file

@ -539,6 +539,10 @@ class FreeTextEditor extends AnnotationEditor {
textContent,
page: { pageNumber },
} = data;
if (!textContent || textContent.length === 0) {
// Empty annotation.
return null;
}
initialData = data = {
annotationType: AnnotationEditorType.FREETEXT,
color: Array.from(fontColor),