diff --git a/pkg/runtime/extension.go b/pkg/runtime/extension.go index 4d731cb4838..eebc9dcfa94 100644 --- a/pkg/runtime/extension.go +++ b/pkg/runtime/extension.go @@ -17,11 +17,16 @@ limitations under the License. package runtime import ( + "errors" + "gopkg.in/v1/yaml" ) func (re *RawExtension) UnmarshalJSON(in []byte) error { - re.RawJSON = in + if re == nil { + return errors.New("runtime.RawExtension: UnmarshalJSON on nil pointer") + } + re.RawJSON = append(re.RawJSON[0:0], in...) return nil }