Prevent errors if PDFDocumentProxy.saveDocument is called without the annotationStorage parameter (PR 12241 follow-up)

Obviously it doesn't make sense to call that method without providing an `AnnotationStorage`-instance, however we should ensure that doing so won't cause errors.
Hence we need to check that `annotationStorage` is actually defined, before attempting to call its `resetModified` method.
This commit is contained in:
Jonas Jenwald 2020-08-22 18:09:17 +02:00
parent f2e3d6c819
commit 1f5021d76a

View File

@ -2544,7 +2544,9 @@ class WorkerTransport {
filename: this._fullReader ? this._fullReader.filename : null,
})
.finally(() => {
if (annotationStorage) {
annotationStorage.resetModified();
}
});
}