changeset 23:ba74a7d3709c

Add try/catch around restoring file state
author Ludovic Chabant <ludovic@chabant.com>
date Fri, 18 Mar 2022 19:23:29 -0700
parents f7e0926c2500
children 61fd7dde51d3
files src/main.ts
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/main.ts	Fri Mar 18 19:25:48 2022 -0700
+++ b/src/main.ts	Fri Mar 18 19:23:29 2022 -0700
@@ -207,7 +207,11 @@
 				//   opened via clicking a hyperlink)
 				// - The file is already currently open in another pane
 				if (!this._suppressNextFileOpen && !this.isFileMultiplyOpen(openedFile)) {
-					this.restoreFileState(openedFile, activeView);
+					try {
+						this.restoreFileState(openedFile, activeView);
+					} catch (err) {
+						console.error("Couldn't restore file state: ", err);
+					}
 				}
 			}
 			// else: the file isn't handled by a markdown editor.