diff --git a/app/models/concerns/foreman_resource_quota/host_managed_extensions.rb b/app/models/concerns/foreman_resource_quota/host_managed_extensions.rb index 3d9793f..a52a78b 100644 --- a/app/models/concerns/foreman_resource_quota/host_managed_extensions.rb +++ b/app/models/concerns/foreman_resource_quota/host_managed_extensions.rb @@ -19,7 +19,7 @@ module HostManagedExtensions # A host shall always have a .host_resources attribute before_validation :build_host_resources, unless: -> { host_resources.present? } - after_save :save_host_resources, if: -> { host_resources.changed? } + after_save :save_host_resources, if: -> { host_resources&.changed? } end def verify_resource_quota