Skip to content

Commit

Permalink
Fixed conditions in network_ip_ends_in_one
Browse files Browse the repository at this point in the history
Prevent undefined method `end_with?' for nil:NilClass (NoMethodError)
  • Loading branch information
MatrixDJ96 committed Aug 26, 2024
1 parent 9df95a2 commit 0b3229b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions plugins/kernel_v2/config/vm.rb
Original file line number Diff line number Diff line change
Expand Up @@ -922,8 +922,8 @@ def validate(machine, ignore_provider=nil)
errors << I18n.t("vagrant.config.vm.network_ip_required")
end
end

if options[:ip] && options[:ip].end_with?(".1") || options[:ip].end_with?(":1") && (options[:type] || "").to_sym != :dhcp
if options[:ip] && (options[:ip].end_with?(".1") || options[:ip].end_with?(":1")) && (options[:type] || "").to_sym != :dhcp
machine.ui.warn(I18n.t(
"vagrant.config.vm.network_ip_ends_in_one"))
end
Expand Down

0 comments on commit 0b3229b

Please sign in to comment.