Skip to content

Commit 53b71b4

Browse files
author
Antoine Pelisse
committed
Nil is not a map
1 parent e05a1f2 commit 53b71b4

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

typed/union.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ func normalizeUnions(w *mergingWalker) error {
3535
}
3636

3737
var old value.Map
38-
if w.lhs != nil {
38+
if w.lhs != nil && !w.lhs.IsNull() {
3939
old = w.lhs.Map()
4040
}
4141
for _, union := range atom.Map.Unions {
@@ -57,7 +57,7 @@ func normalizeUnionsApply(w *mergingWalker) error {
5757
}
5858

5959
var old value.Map
60-
if w.lhs != nil {
60+
if w.lhs != nil && !w.lhs.IsNull() {
6161
old = w.lhs.Map()
6262
}
6363

value/valueunstructured.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ func (v valueUnstructured) IsMap() bool {
5151

5252
func (v valueUnstructured) Map() Map {
5353
if v.Value == nil {
54-
return nil
54+
panic("invalid nil")
5555
}
5656
switch t := v.Value.(type) {
5757
case map[string]interface{}:

0 commit comments

Comments
 (0)