Skip to content

Commit b5ece0b

Browse files
committed
slight fix
1 parent a0e956c commit b5ece0b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/codeEditorView.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,18 @@ export class CodeEditorView extends TextFileView {
2121
}
2222

2323
getContext(file?: TFile) {
24-
return file?.path ?? this.file.path;
24+
return file?.path ?? this.file?.path;
2525
}
2626

2727
async onClose() {
2828
await super.onClose();
29-
console.log("!!onClose", this.file.name, this.id);
29+
console.log("!!onClose", this.file?.name, this.id);
3030
this.iframe?.remove();
3131
}
3232

3333
async onLoadFile(file: TFile) {
3434
await super.onLoadFile(file);
35-
console.log("!!onLoadFile", this.id, this.file.name, file.name)
35+
console.log("!!onLoadFile", this.id, this.file?.name, file.name)
3636

3737
const theme = this.plugin.settings.isDark ? "vs-dark" : "vs";
3838

0 commit comments

Comments
 (0)