]> source.dussan.org Git - sonarqube.git/commitdiff
Update migration to do nothing if no rule found for an issue
authorJulien Lancelot <julien.lancelot@sonarsource.com>
Mon, 10 Feb 2014 07:10:05 +0000 (08:10 +0100)
committerJulien Lancelot <julien.lancelot@sonarsource.com>
Mon, 10 Feb 2014 07:10:05 +0000 (08:10 +0100)
sonar-server/src/main/webapp/WEB-INF/db/migrate/497_update_issue_message_by_rule_name_when_no_message.rb

index e439888a9d44daf8ffd611f7dc72aa690c60adbf..e72c4a636f76281e95ed0c13e134c32b05389a4a 100644 (file)
@@ -37,8 +37,10 @@ class UpdateIssueMessageByRuleNameWhenNoMessage < ActiveRecord::Migration
         :conditions => 'message IS NULL'
     )
     issuesWithoutMessage.each do |issue|
-      issue.message = issue.rule.name
-      issue.save!
+      if issue.rule
+        issue.message = issue.rule.name
+        issue.save!
+      end
     end
   end
 end