Skip to content

Commit

Permalink
No longer assume that a value is an array
Browse files Browse the repository at this point in the history
We found a situation where an ||= was failing because the result was nil as opposed to an array.
Adding a .try to the lookup allows us to pass nil in these specific cases.

https://bugzilla.redhat.com/show_bug.cgi?id=1540326
  • Loading branch information
syncrou committed Feb 1, 2018
1 parent 0ae4687 commit 698a346
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/miq_provision_virt_workflow.rb
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ def set_on_vm_id_changed
f[:notes] = vm_description
when :vlan
get_field(:vlan)
vlan ||= @values[fn].first
vlan ||= Array(@values[fn]).first
set_value_from_list(fn, f, vlan, allowed_vlans)
end
end
Expand Down

0 comments on commit 698a346

Please sign in to comment.