]> source.dussan.org Git - sonarqube.git/commitdiff
Fix regression when saving widget configuration
authorFabrice Bellingard <fabrice.bellingard@sonarsource.com>
Mon, 8 Oct 2012 09:29:38 +0000 (11:29 +0200)
committerFabrice Bellingard <fabrice.bellingard@sonarsource.com>
Mon, 8 Oct 2012 14:14:52 +0000 (16:14 +0200)
=> params[:resource_id] can be null in case of non global dashboard

sonar-server/src/main/webapp/WEB-INF/app/controllers/dashboard_controller.rb

index a4d9cce2c808273c29547caa464cf48ad4de6720..08f0b5a92918c9aa61c0a41a773db0047b6af9a9 100644 (file)
@@ -119,7 +119,7 @@ class DashboardController < ApplicationController
           prop.save!
         end
       end
-      widget.resource_id=Project.by_key(params[:resource_id]).id
+      widget.resource_id=Project.by_key(params[:resource_id]).id if params[:resource_id]
       widget.configured=true
       widget.save!
       render :update do |page|