From a36a83d0e922a689b4a5e218a538706fdf4870f9 Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Thu, 16 Feb 2012 22:03:09 +0100 Subject: SONAR-3254 do not fail when violation line is not correct --- .../src/main/webapp/WEB-INF/app/controllers/resource_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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<