about summary refs log tree commit diff
path: root/app
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2022-03-07 11:21:27 +0100
committerGitHub <noreply@github.com>2022-03-07 11:21:27 +0100
commit292c75aa319c877406356a1cb4fb41f4ab597cfd (patch)
tree2a95b88cdf686668b09f6d94e567003b7501c72a /app
parentedf09ec747ebba5a170e27eb13663462a116ec6c (diff)
Fix nil error when submitting report without `rule_ids` (#17713)
Diffstat (limited to 'app')
-rw-r--r--app/models/report.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/report.rb b/app/models/report.rb
index 3dd8a6fdd..8ba2dd8fd 100644
--- a/app/models/report.rb
+++ b/app/models/report.rb
@@ -129,6 +129,6 @@ class Report < ApplicationRecord
   def validate_rule_ids
     return unless violation?
 
-    errors.add(:rule_ids, I18n.t('reports.errors.invalid_rules')) unless rules.size == rule_ids.size
+    errors.add(:rule_ids, I18n.t('reports.errors.invalid_rules')) unless rules.size == rule_ids&.size
   end
 end