diff --git a/src/display/api.js b/src/display/api.js
index 453e073a5..f9a295dcc 100644
--- a/src/display/api.js
+++ b/src/display/api.js
@@ -2544,7 +2544,9 @@ class WorkerTransport {
         filename: this._fullReader ? this._fullReader.filename : null,
       })
       .finally(() => {
-        annotationStorage.resetModified();
+        if (annotationStorage) {
+          annotationStorage.resetModified();
+        }
       });
   }