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:
parent
122f20905c
commit
55b6394bf3
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user