Skip to content

Commit 21770e1

Browse files
committed
Fix server error on VM reconfigure when host is nil
1 parent 6f39b30 commit 21770e1

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

app/controllers/mixins/actions/vm_actions/reconfigure.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,8 @@ def reconfigure_calculations(mbsize)
213213

214214
# determine available switches for this host...
215215
def get_vlan_options(host)
216+
return [] unless host.present?
217+
216218
switch_ids = Rbac.filtered(host.switches).pluck(:id)
217219
Rbac.filtered(Lan.where(:switch_id => switch_ids).order(:name)).pluck(:name)
218220
end

0 commit comments

Comments
 (0)