diff --git a/Godeps/Godeps.json b/Godeps/Godeps.json index 899a32fc166..67330aae099 100644 --- a/Godeps/Godeps.json +++ b/Godeps/Godeps.json @@ -1212,7 +1212,7 @@ }, { "ImportPath": "github.com/evanphx/json-patch", - "Rev": "944e07253867aacae43c04b2e6a239005443f33a" + "Rev": "ed7cfbae1fffc071f71e068df27bf4f0521402d8" }, { "ImportPath": "github.com/exponent-io/jsonpath", diff --git a/staging/src/k8s.io/apiextensions-apiserver/Godeps/Godeps.json b/staging/src/k8s.io/apiextensions-apiserver/Godeps/Godeps.json index 810efc368ad..4f80a44254e 100644 --- a/staging/src/k8s.io/apiextensions-apiserver/Godeps/Godeps.json +++ b/staging/src/k8s.io/apiextensions-apiserver/Godeps/Godeps.json @@ -372,7 +372,7 @@ }, { "ImportPath": "github.com/evanphx/json-patch", - "Rev": "944e07253867aacae43c04b2e6a239005443f33a" + "Rev": "ed7cfbae1fffc071f71e068df27bf4f0521402d8" }, { "ImportPath": "github.com/ghodss/yaml", diff --git a/staging/src/k8s.io/apimachinery/Godeps/Godeps.json b/staging/src/k8s.io/apimachinery/Godeps/Godeps.json index 8c309a8d0a9..7835fa8a234 100644 --- a/staging/src/k8s.io/apimachinery/Godeps/Godeps.json +++ b/staging/src/k8s.io/apimachinery/Godeps/Godeps.json @@ -24,7 +24,7 @@ }, { "ImportPath": "github.com/evanphx/json-patch", - "Rev": "944e07253867aacae43c04b2e6a239005443f33a" + "Rev": "ed7cfbae1fffc071f71e068df27bf4f0521402d8" }, { "ImportPath": "github.com/ghodss/yaml", diff --git a/staging/src/k8s.io/apiserver/Godeps/Godeps.json b/staging/src/k8s.io/apiserver/Godeps/Godeps.json index 5159a5b3181..880b2efce01 100644 --- a/staging/src/k8s.io/apiserver/Godeps/Godeps.json +++ b/staging/src/k8s.io/apiserver/Godeps/Godeps.json @@ -372,7 +372,7 @@ }, { "ImportPath": "github.com/evanphx/json-patch", - "Rev": "944e07253867aacae43c04b2e6a239005443f33a" + "Rev": "ed7cfbae1fffc071f71e068df27bf4f0521402d8" }, { "ImportPath": "github.com/ghodss/yaml", diff --git a/staging/src/k8s.io/kube-aggregator/Godeps/Godeps.json b/staging/src/k8s.io/kube-aggregator/Godeps/Godeps.json index 39104c3522d..35c85bb0780 100644 --- a/staging/src/k8s.io/kube-aggregator/Godeps/Godeps.json +++ b/staging/src/k8s.io/kube-aggregator/Godeps/Godeps.json @@ -112,7 +112,7 @@ }, { "ImportPath": "github.com/evanphx/json-patch", - "Rev": "944e07253867aacae43c04b2e6a239005443f33a" + "Rev": "ed7cfbae1fffc071f71e068df27bf4f0521402d8" }, { "ImportPath": "github.com/ghodss/yaml", diff --git a/staging/src/k8s.io/sample-apiserver/Godeps/Godeps.json b/staging/src/k8s.io/sample-apiserver/Godeps/Godeps.json index cc11b727df9..9123cc5c86c 100644 --- a/staging/src/k8s.io/sample-apiserver/Godeps/Godeps.json +++ b/staging/src/k8s.io/sample-apiserver/Godeps/Godeps.json @@ -104,7 +104,7 @@ }, { "ImportPath": "github.com/evanphx/json-patch", - "Rev": "944e07253867aacae43c04b2e6a239005443f33a" + "Rev": "ed7cfbae1fffc071f71e068df27bf4f0521402d8" }, { "ImportPath": "github.com/ghodss/yaml", diff --git a/vendor/github.com/evanphx/json-patch/patch.go b/vendor/github.com/evanphx/json-patch/patch.go index de70dbca78e..755d8ba3b1b 100644 --- a/vendor/github.com/evanphx/json-patch/patch.go +++ b/vendor/github.com/evanphx/json-patch/patch.go @@ -66,6 +66,10 @@ func (n *lazyNode) intoDoc() (*partialDoc, error) { return &n.doc, nil } + if n.raw == nil { + return nil, fmt.Errorf("Unable to unmarshal nil pointer as partial document") + } + err := json.Unmarshal(*n.raw, &n.doc) if err != nil { @@ -81,6 +85,10 @@ func (n *lazyNode) intoAry() (*partialArray, error) { return &n.ary, nil } + if n.raw == nil { + return nil, fmt.Errorf("Unable to unmarshal nil pointer as partial array") + } + err := json.Unmarshal(*n.raw, &n.ary) if err != nil { @@ -94,6 +102,10 @@ func (n *lazyNode) intoAry() (*partialArray, error) { func (n *lazyNode) compact() []byte { buf := &bytes.Buffer{} + if n.raw == nil { + return nil + } + err := json.Compact(buf, *n.raw) if err != nil { @@ -104,6 +116,10 @@ func (n *lazyNode) compact() []byte { } func (n *lazyNode) tryDoc() bool { + if n.raw == nil { + return false + } + err := json.Unmarshal(*n.raw, &n.doc) if err != nil { @@ -115,6 +131,10 @@ func (n *lazyNode) tryDoc() bool { } func (n *lazyNode) tryAry() bool { + if n.raw == nil { + return false + } + err := json.Unmarshal(*n.raw, &n.ary) if err != nil {