diff --git a/app/views/wds_servers/_image_select.html.erb b/app/views/wds_servers/_image_select.html.erb index e06089bd13e9720a194d8ed0112eaacfcacce52b..98f2922ed52bc7a2b7bdcd7d4be079f8c204e121 100644 --- a/app/views/wds_servers/_image_select.html.erb +++ b/app/views/wds_servers/_image_select.html.erb @@ -2,8 +2,8 @@ <%- host = @host || f.object.host server = host.public_send(:wds_server) rescue nil - images = server.all_images rescue [] - images = images.select { |img| img.matches_architecture?(host.architecture) && img.enabled } if host.architecture + images = (server.all_images rescue []).select(&:enabled) + images = images.select { |img| img.matches_architecture?(host.architecture) } if host.architecture boot_images = images.select { |img| img.is_a?(ForemanWds::WdsBootImage) } install_images = images.select { |img| img.is_a?(ForemanWds::WdsInstallImage) }