mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-22 16:18:08 +02:00
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:
parent
f2e3d6c819
commit
1f5021d76a
1 changed files with 3 additions and 1 deletions
|
@ -2544,7 +2544,9 @@ class WorkerTransport {
|
|||
filename: this._fullReader ? this._fullReader.filename : null,
|
||||
})
|
||||
.finally(() => {
|
||||
annotationStorage.resetModified();
|
||||
if (annotationStorage) {
|
||||
annotationStorage.resetModified();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue