mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Merge pull request #1104 from omnivore-app/fix/update-label-script-exception
Fix getting script_exception when updating labels in highlights by checking null before updating
This commit is contained in:
commit
31382a8b8e
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