Skip to content

Commit ab1a4f1

Browse files
committed
yaml: avoid potential nil panic
Signed-off-by: Akihiro Suda <[email protected]>
1 parent 76be255 commit ab1a4f1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/limayaml/validate.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ func Validate(y LimaYAML, warn bool) error {
165165
// processed sequentially and the first matching rule for a guest port determines forwarding behavior.
166166
}
167167

168-
if *y.UseHostResolver && len(y.DNS) > 0 {
168+
if y.UseHostResolver != nil && *y.UseHostResolver && len(y.DNS) > 0 {
169169
return fmt.Errorf("field `dns` must be empty when field `useHostResolver` is true")
170170
}
171171

0 commit comments

Comments
 (0)