mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Fix getting script_exception when updating labels in highlights by checking null before updating
This commit is contained in:
parent
3b6cf4d4c2
commit
0a75c52a8c
1 changed files with 1 additions and 1 deletions
|
|
@ -186,7 +186,7 @@ export const updateLabel = async (
|
|||
ctx._source.labels.add(params.label);
|
||||
ctx._source.updatedAt = params.updatedAt
|
||||
}
|
||||
if (ctx._source.highlights != null) {
|
||||
if (ctx._source.highlights != null && ctx._source.highlights[0].labels != null) {
|
||||
ctx._source.highlights[0].labels.removeIf(l -> l.id == params.label.id);
|
||||
ctx._source.highlights[0].labels.add(params.label);
|
||||
ctx._source.updatedAt = params.updatedAt
|
||||
|
|
|
|||
Loading…
Reference in a new issue