From f98724f7fce3ad44d7ade923f56c05a15ebdd1a3 Mon Sep 17 00:00:00 2001 From: Julien Lancelot Date: Wed, 5 Jun 2013 09:38:02 +0200 Subject: [PATCH] SONAR-3755 Do not display errors node when no error in WS --- .../WEB-INF/app/controllers/api/action_plans_controller.rb | 2 +- .../webapp/WEB-INF/app/controllers/api/issues_controller.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/api/action_plans_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/api/action_plans_controller.rb index 9e8fdfa36ec..d9cb352452a 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/api/action_plans_controller.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/api/action_plans_controller.rb @@ -152,7 +152,7 @@ class Api::ActionPlansController < Api::ApiController def result_to_hash(result) hash = {} - if result.errors + if result.errors and !result.errors.empty? hash[:errors] = result.errors().map do |error| { :msg => (error.text ? error.text : Api::Utils.message(error.l10nKey, :params => error.l10nParams)) diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/api/issues_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/api/issues_controller.rb index a4a83556c18..7d21da4eb0d 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/api/issues_controller.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/api/issues_controller.rb @@ -286,7 +286,7 @@ class Api::IssuesController < Api::ApiController def result_to_hash(result) hash = {} - if result.errors + if result.errors and !result.errors.empty? hash[:errors] = result.errors().map do |error| { :msg => (error.text ? error.text : Api::Utils.message(error.l10nKey, :params => error.l10nParams)) -- 2.39.5