From 12d816b761b06f4f150c9b6330be3393967c63b2 Mon Sep 17 00:00:00 2001 From: Elio Struyf Date: Fri, 24 Sep 2021 08:45:45 +0200 Subject: [PATCH] #114 - Empty array fix + empty data --- src/explorerView/ExplorerView.ts | 4 +++- src/panelWebView/components/TagPicker.tsx | 7 ++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/explorerView/ExplorerView.ts b/src/explorerView/ExplorerView.ts index 30ecfa11..3f2a4ab3 100644 --- a/src/explorerView/ExplorerView.ts +++ b/src/explorerView/ExplorerView.ts @@ -433,7 +433,9 @@ export class ExplorerView implements WebviewViewProvider, Disposable { } const article = ArticleHelper.getFrontMatter(editor); - this.pushMetadata(article!.data); + if (article?.data) { + this.pushMetadata(article!.data); + } } /** diff --git a/src/panelWebView/components/TagPicker.tsx b/src/panelWebView/components/TagPicker.tsx index 877515e5..19b254e6 100644 --- a/src/panelWebView/components/TagPicker.tsx +++ b/src/panelWebView/components/TagPicker.tsx @@ -186,7 +186,12 @@ export const TagPicker: React.FunctionComponent = (props: React } - a.toLowerCase() < b.toLowerCase() ? -1 : 1 )} onRemove={onRemove} onCreate={onCreate} options={options} disableConfigurable={!!disableConfigurable} /> + a.toLowerCase() < b.toLowerCase() ? -1 : 1 )} + onRemove={onRemove} + onCreate={onCreate} + options={options} + disableConfigurable={!!disableConfigurable} /> ); }; \ No newline at end of file