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 <HASH>..<HASH> 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
@@ -162,7 +162,7 @@ class ResourceController < ApplicationController
     @display_manual_violation_form=(current_user && has_role?(:user, @snapshot))
 
     panel = get_html_source_panel(@snapshot, {:display_scm => true})
-    @lines = panel.html_lines
+    @lines = panel.html_lines unless panel.nil?
   end
 
   def init_scm
SONAR-<I> Fixed uncaught error when no source is available