#114 - Empty array fix + empty data

This commit is contained in:
Elio Struyf
2021-09-24 08:45:45 +02:00
parent 0e13a3783f
commit 12d816b761
2 changed files with 9 additions and 2 deletions
+3 -1
View File
@@ -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);
}
}
/**
+6 -1
View File
@@ -186,7 +186,12 @@ export const TagPicker: React.FunctionComponent<ITagPickerProps> = (props: React
}
</Downshift>
<Tags values={selected.sort((a: string, b: string) => a.toLowerCase() < b.toLowerCase() ? -1 : 1 )} onRemove={onRemove} onCreate={onCreate} options={options} disableConfigurable={!!disableConfigurable} />
<Tags
values={(selected || []).sort((a: string, b: string) => a.toLowerCase() < b.toLowerCase() ? -1 : 1 )}
onRemove={onRemove}
onCreate={onCreate}
options={options}
disableConfigurable={!!disableConfigurable} />
</div>
);
};