Skip to content

Commit 55a7e62

Browse files
authored
Merge pull request #1184 from pjkaufman/master
Protect Against Null Reference
2 parents b29f66c + 4f3c211 commit 55a7e62

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/main.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,11 @@ export default class LinterPlugin extends Plugin {
232232
icon: iconInfo.folder.id,
233233
editorCheckCallback: (checking: Boolean, _, ctx) => {
234234
if (checking) {
235-
return !ctx.file.parent.isRoot();
235+
if (ctx && ctx.file && ctx.file instanceof TFile && ctx.file.parent) {
236+
return !ctx.file.parent.isRoot();
237+
}
238+
239+
return false;
236240
}
237241

238242
this.createFolderLintModal(ctx.file.parent);

0 commit comments

Comments
 (0)