Skip to content

Commit

Permalink
fix: Crash if no active file
Browse files Browse the repository at this point in the history
  • Loading branch information
HEmile committed Sep 15, 2023
1 parent 8c445f9 commit db02a5d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,10 @@ export default class SuperchargedLinks extends Plugin {
for (let i = 0; i < propertyLeaves.length; i++) {
const container = propertyLeaves[i].view.containerEl;
let observer = new MutationObserver((records, _) =>{
updatePropertiesPane(container, app.workspace.getActiveFile(), app, plugin);
const file = app.workspace.getActiveFile();
if (!!file) {
updatePropertiesPane(container, app.workspace.getActiveFile(), app, plugin);
}
});
observer.observe(container, {subtree: true, childList: true, attributes: false});
plugin.observers.push([observer, "file-properties" + i, ""]);
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "supercharged-links-obsidian",
"name": "Supercharged Links",
"version": "0.10.2",
"version": "0.10.3",
"minAppVersion": "1.4.0",
"description": "Add properties and menu options to links and style them!",
"author": "mdelobelle & Emile",
Expand Down

0 comments on commit db02a5d

Please sign in to comment.