diff --git a/src/core/annotation.js b/src/core/annotation.js index bddaeab99..b43ae5a7b 100644 --- a/src/core/annotation.js +++ b/src/core/annotation.js @@ -1510,7 +1510,8 @@ class ButtonWidgetAnnotation extends WidgetAnnotation { return this._saveRadioButton(evaluator, task, annotationStorage); } - return super.save(evaluator, task, annotationStorage); + // Nothing to save + return null; } async _saveCheckbox(evaluator, task, annotationStorage) { diff --git a/test/unit/annotation_spec.js b/test/unit/annotation_spec.js index d7fef39bf..4643d79a3 100644 --- a/test/unit/annotation_spec.js +++ b/test/unit/annotation_spec.js @@ -2317,6 +2317,29 @@ describe("annotation", function () { done(); }, done.fail); }); + + it("should save nothing", function (done) { + const buttonWidgetRef = Ref.get(124, 0); + const xref = new XRefMock([ + { ref: buttonWidgetRef, data: buttonWidgetDict }, + ]); + const task = new WorkerTask("test save"); + + AnnotationFactory.create( + xref, + buttonWidgetRef, + pdfManagerMock, + idFactoryMock + ) + .then(annotation => { + return annotation.save(partialEvaluator, task, {}); + }) + .then(data => { + expect(data).toEqual(null); + done(); + }) + .catch(done.fail); + }); }); describe("ChoiceWidgetAnnotation", function () {