Don't try to close the altText dialog if it's not open (PR 16977 follow-up)

When closing a document in the viewer, e.g. by running `PDFViewerApplication.close()` in the console, the `AltTextManager.#finish` method currently throws *unless* the `altText` dialog is actually open.
Similar to e.g. the PasswordPrompt, we should thus only attempt to close the `altText` dialog when it's open.
This commit is contained in:
Jonas Jenwald 2023-09-20 07:45:33 +02:00
parent 8d326e5e30
commit 21c55b56bf

View File

@ -152,7 +152,7 @@ class AltTextManager {
}
#finish() {
if (this.#dialog) {
if (this.#overlayManager.active === this.#dialog) {
this.#overlayManager.close(this.#dialog);
}
}