aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@gmail.com>2012-02-16 22:03:09 +0100
committerSimon Brandhof <simon.brandhof@gmail.com>2012-02-16 22:03:09 +0100
commita36a83d0e922a689b4a5e218a538706fdf4870f9 (patch)
treeef884a1f2ec834bf8bb700dcf03be641e59e31ce
parentb927e75930e82b95b65c8170091d8a0d15db7bbf (diff)
downloadsonarqube-a36a83d0e922a689b4a5e218a538706fdf4870f9.tar.gz
sonarqube-a36a83d0e922a689b4a5e218a538706fdf4870f9.zip
SONAR-3254 do not fail when violation line is not correct
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/controllers/resource_controller.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/resource_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/resource_controller.rb
index 07a33890371..087771bc59c 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/resource_controller.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/resource_controller.rb
@@ -395,7 +395,7 @@ class ResourceController < ApplicationController
RuleFailure.find(:all, :include => ['rule', 'review'], :conditions => [conditions] + values, :order => 'failure_level DESC').each do |violation|
# sorted by severity => from blocker to info
- if violation.line && violation.line>0 && @lines
+ if @lines && violation.line && violation.line>0 && violation.line<=@lines.size
@lines[violation.line-1].add_violation(violation)
else
@global_violations<<violation