mirror of
https://github.com/Ellpeck/ObsidianJustSharePlease.git
synced 2024-11-22 18:38:35 +01:00
don't cast blindly
This commit is contained in:
parent
c7be82d5fa
commit
46cfbdfd36
1 changed files with 3 additions and 1 deletions
|
@ -17,7 +17,9 @@ export class JSPView extends ItemView {
|
|||
let content = this.contentEl.createDiv({cls: "just-share-please-view"});
|
||||
if (this.plugin.settings.shared.length > 0) {
|
||||
for (let shared of this.plugin.settings.shared) {
|
||||
let file = this.plugin.app.vault.getAbstractFileByPath(shared.path) as TFile;
|
||||
let file = this.plugin.app.vault.getAbstractFileByPath(shared.path) ;
|
||||
if(!(file instanceof TFile))
|
||||
continue;
|
||||
let div = content.createDiv({cls: "just-share-please-shared-item"});
|
||||
div.createSpan({cls: "just-share-please-shared-name", text: removeExtension(shared.path).split(/[/\\]/g).pop()});
|
||||
if (file?.path.match(/[/\\]/))
|
||||
|
|
Loading…
Reference in a new issue