Skip to content
This repository was archived by the owner on Jul 28, 2025. It is now read-only.

Commit fbb7525

Browse files
committed
Merge branch '660-bug-an-error-occurred-while-loading-obsidian-typeerror-cannot-read-properties-of-null-reading-path'
2 parents 8cfa3f2 + c380863 commit fbb7525

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

src/DatabaseView.tsx

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -218,13 +218,14 @@ export class DatabaseView extends TextFileView implements HoverParent {
218218
}
219219

220220
destroy() {
221-
LOGGER.info(`=>destroy ${this.file.path}`);
222-
// Remove draggables from render, as the DOM has already detached
223-
this.getStateManager().unregisterView(this);
224-
this.plugin.removeView(this);
225-
this.tableContainer.remove();
226-
this.detachViewComponents();
227-
LOGGER.info(`<=destroy ${this.file.path}`);
221+
if (this.file) {
222+
// Remove draggables from render, as the DOM has already detached
223+
this.getStateManager().unregisterView(this);
224+
this.plugin.removeView(this);
225+
this.tableContainer.remove();
226+
this.detachViewComponents();
227+
LOGGER.info(`Closed view ${this.file.path}}`);
228+
}
228229
}
229230

230231
async onClose() {

0 commit comments

Comments
 (0)