Skip to content

Instantly share code, notes, and snippets.

@GregSutcliffe
Created June 17, 2014 16:15
Show Gist options
  • Select an option

  • Save GregSutcliffe/a62baadaa42558bf8870 to your computer and use it in GitHub Desktop.

Select an option

Save GregSutcliffe/a62baadaa42558bf8870 to your computer and use it in GitHub Desktop.
diff --git a/app/helpers/katello/hosts_and_hostgroups_helper.rb b/app/helpers/katello/hosts_and_hostgroups_helper.rb
index dfbd7d7..684f8ac 100644
--- a/app/helpers/katello/hosts_and_hostgroups_helper.rb
+++ b/app/helpers/katello/hosts_and_hostgroups_helper.rb
@@ -42,7 +42,7 @@ module Katello
where("#{::Organization.table_name}.label" => kt_org_label).first
%[<option value="#{kt_org_label}/#{kt_env_label}"
- class="kt-env" data-katello-env-id="#{kt_env.id}"
+ class="kt-env" data-katello-env-id="#{kt_env.try(:id)}"
#{selected}>#{kt_env_label}</option>]
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment