Skip to content

Commit 15fe4ce

Browse files
committed
Fix some missing copies in Clone
1 parent 299c863 commit 15fe4ce

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

pkg/instance/instance.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,9 @@ func (i *Instance) SetRev(v string) { i.DocRev = v }
172172
func (i *Instance) Clone() couchdb.Doc {
173173
cloned := *i
174174

175+
cloned.DomainAliases = make([]string, len(i.DomainAliases))
176+
copy(cloned.DomainAliases, i.DomainAliases)
177+
175178
cloned.PassphraseHash = make([]byte, len(i.PassphraseHash))
176179
copy(cloned.PassphraseHash, i.PassphraseHash)
177180

pkg/notification/notifications.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ func (n *Notification) Clone() couchdb.Doc {
7777
for k, v := range n.Data {
7878
cloned.Data[k] = v
7979
}
80+
cloned.PreferredChannels = make([]string, len(n.PreferredChannels))
81+
copy(cloned.PreferredChannels, n.PreferredChannels)
8082
return &cloned
8183
}
8284

0 commit comments

Comments
 (0)