Skip to content

Commit 0b03b0e

Browse files
authored
Merge pull request #440 from q384566678/windons-check
validate: avoid panic on nil fields
2 parents 6bcd3b4 + bb7921b commit 0b03b0e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

validate/validate.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ func (v *Validator) CheckAll() (msgs []string) {
111111
func (v *Validator) CheckRoot() (msgs []string) {
112112
logrus.Debugf("check root")
113113

114-
if v.platform == "windows" && v.spec.Windows.HyperV != nil {
114+
if v.platform == "windows" && v.spec.Windows != nil && v.spec.Windows.HyperV != nil {
115115
if v.spec.Root != nil {
116116
msgs = append(msgs, fmt.Sprintf("for Hyper-V containers, Root must not be set"))
117117
return

0 commit comments

Comments
 (0)