mirror of
https://github.com/kovetskiy/mark.git
synced 2026-03-14 14:17:37 +08:00
fix: skip label sync when metadata is absent
When PageID mode is used (meta == nil), labels is nil and calling updateLabels unconditionally treats that as an empty desired set, silently removing all existing global labels from the page. Guard the call so label syncing only runs when metadata is present. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
parent
e68a9f64ff
commit
06c3afef25
6
mark.go
6
mark.go
@ -390,8 +390,10 @@ func ProcessFile(file string, api *confluence.API, config Config) (*confluence.P
|
||||
}
|
||||
}
|
||||
|
||||
if err := updateLabels(api, target, labels); err != nil {
|
||||
return nil, err
|
||||
if meta != nil {
|
||||
if err := updateLabels(api, target, labels); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
if config.EditLock {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user