Skip to content

Commit 71fa2f6

Browse files
authored
💄 make array when filters is nil (#959)
Signed-off-by: Matthias Wessendorf <[email protected]>
1 parent 02eee15 commit 71fa2f6

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

cmd/subscribe.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,11 @@ func updateOrAddSubscription(subscriptions []fn.KnativeSubscription, cfg subscib
9595
for i, subscription := range subscriptions {
9696
if subscription.Source == cfg.Source {
9797
found = true
98+
99+
if subscription.Filters == nil {
100+
subscription.Filters = make(map[string]string)
101+
}
102+
98103
// Update filters. Override if the key already exists.
99104
for newKey, newValue := range newFilters {
100105
subscription.Filters[newKey] = newValue

0 commit comments

Comments
 (0)