1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-01-11 18:24:43 +02:00

Desktop: Fixes #4051: Random crash when syncing due to undefined tags

This commit is contained in:
Laurent Cozic 2020-11-06 10:50:44 +00:00
parent 122f20905c
commit 55b6394bf3

View File

@ -51,6 +51,13 @@ shared.renderFolders = function(props, renderItem) {
shared.renderTags = function(props, renderItem) {
const tags = props.tags.slice();
tags.sort((a, b) => {
// It seems title can sometimes be undefined (perhaps when syncing
// and before tag has been decrypted?). It would be best to find
// the root cause but for now that will do.
//
// Fixes https://github.com/laurent22/joplin/issues/4051
if (!a || !a.title || !b || !b.title) return 0;
// Note: while newly created tags are normalized and lowercase
// imported tags might be any case, so we need to do case-insensitive
// sort.