From 698a3466097f4811371b0e9eb35b528735c733ce Mon Sep 17 00:00:00 2001 From: Drew Bomhof Date: Wed, 31 Jan 2018 17:12:18 -0500 Subject: [PATCH] No longer assume that a value is an array 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 --- app/models/miq_provision_virt_workflow.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/miq_provision_virt_workflow.rb b/app/models/miq_provision_virt_workflow.rb index f61f9460ce4..ae9643595e1 100644 --- a/app/models/miq_provision_virt_workflow.rb +++ b/app/models/miq_provision_virt_workflow.rb @@ -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