Skip to content

Commit

Permalink
fix: Crashes when handling supercharging properties
Browse files Browse the repository at this point in the history
  • Loading branch information
HEmile committed Sep 7, 2023
1 parent 53b6364 commit 8c445f9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
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.0",
"version": "0.10.2",
"minAppVersion": "1.4.0",
"description": "Add properties and menu options to links and style them!",
"author": "mdelobelle & Emile",
Expand Down
6 changes: 6 additions & 0 deletions src/linkAttributes/linkAttributes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,9 @@ export function updatePropertiesPane(propertiesEl: HTMLElement, file: TFile, app
const key = keyEl.value;
const listOfLinks: [string] = frontmatter[key];
let foundS = null;
if (!listOfLinks) {
continue;
}
for (const s of listOfLinks) {
if (s.length > 4 && s.startsWith("[[") && s.endsWith("]]")) {
const slicedS = s.slice(2, -2);
Expand All @@ -171,6 +174,9 @@ export function updatePropertiesPane(propertiesEl: HTMLElement, file: TFile, app
// @ts-ignore
const key = keyEl.value;
const link: string = frontmatter[key];
if (!link) {
continue;
}
let foundS: string = null;
if (link.length > 4 && link.startsWith("[[") && link.endsWith("]]")) {
const slicedS = link.slice(2, -2);
Expand Down

0 comments on commit 8c445f9

Please sign in to comment.