From 0e5515c8ae4c37e8b4ab7439f456eb97e387ef72 Mon Sep 17 00:00:00 2001 From: pfurio Date: Thu, 19 Sep 2024 14:56:03 +0200 Subject: [PATCH] server: avoid NPE when body of POST WS is null, #TASK-4073 --- .../server/rest/operations/VariantOperationWebService.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/opencga-server/src/main/java/org/opencb/opencga/server/rest/operations/VariantOperationWebService.java b/opencga-server/src/main/java/org/opencb/opencga/server/rest/operations/VariantOperationWebService.java index 14fb051c85..4b9613b926 100644 --- a/opencga-server/src/main/java/org/opencb/opencga/server/rest/operations/VariantOperationWebService.java +++ b/opencga-server/src/main/java/org/opencb/opencga/server/rest/operations/VariantOperationWebService.java @@ -593,7 +593,12 @@ public Response submitOperationToProject(String toolId, String project, ToolPara public Response submitOperation(String toolId, String project, String study, ToolParams params, String jobName, String jobDescription, String jobDependsOn, String jobTags, String jobScheduledStartTime, String jobPriority, Boolean dryRun) { try { - Map paramsMap = params.toParams(); + Map paramsMap; + if (params != null) { + paramsMap = params.toParams(); + } else { + paramsMap = new HashMap<>(); + } if (StringUtils.isNotEmpty(study)) { paramsMap.put(ParamConstants.STUDY_PARAM, study); }