]> source.dussan.org Git - sonarqube.git/commitdiff
fix adding first condition to quality gate
authorStas Vilchik <vilchiks@gmail.com>
Mon, 21 Mar 2016 09:29:11 +0000 (10:29 +0100)
committerStas Vilchik <vilchiks@gmail.com>
Mon, 21 Mar 2016 13:18:29 +0000 (14:18 +0100)
server/sonar-web/src/main/js/apps/quality-gates/store/utils.js

index 81247f6393b7ba9de086bc20884e3af4c4494467..5927e84acbc13272f5d445108479c1195bf60811 100644 (file)
@@ -30,7 +30,8 @@ export function addCondition (qualityGate, metric) {
     warning: '',
     error: ''
   };
-  const conditions = [...qualityGate.conditions, condition];
+  const oldConditions = qualityGate.conditions || [];
+  const conditions = [...oldConditions, condition];
 
   return { ...qualityGate, conditions };
 }