aboutsummaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorSébastien Lesaint <sebastien.lesaint@sonarsource.com>2017-07-10 16:16:05 +0200
committerSébastien Lesaint <sebastien.lesaint@sonarsource.com>2017-07-21 12:20:52 +0200
commitc699bdd89cd60664d14d32fa098335346ea59034 (patch)
tree863ec6b65f0e365e5f31b42d8dd53248b190b013 /server
parent658d8c5f4ceb5f7a8dbf6c27ab2f37bef3486f9e (diff)
downloadsonarqube-c699bdd89cd60664d14d32fa098335346ea59034.tar.gz
sonarqube-c699bdd89cd60664d14d32fa098335346ea59034.zip
SONAR-9488 don't open DB connection when file is missing
in api/qualityprofiles/restore
Diffstat (limited to 'server')
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/qualityprofile/ws/RestoreAction.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/ws/RestoreAction.java b/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/ws/RestoreAction.java
index 44f977f87bc..4c8f3e6e96a 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/ws/RestoreAction.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/ws/RestoreAction.java
@@ -83,11 +83,11 @@ public class RestoreAction implements QProfileWsAction {
userSession.checkLoggedIn();
InputStream backup = request.paramAsInputStream(PARAM_BACKUP);
+ checkArgument(backup != null, "A backup file must be provided");
String organizationKey = request.param(PARAM_ORGANIZATION);
InputStreamReader reader = null;
try (DbSession dbSession = dbClient.openSession(false)) {
- checkArgument(backup != null, "A backup file must be provided");
reader = new InputStreamReader(backup, UTF_8);
OrganizationDto organization = wsSupport.getOrganizationByKey(dbSession, organizationKey);