Skip to content

Commit 0041ee6

Browse files
committed
Fix issues related to JSONObject migration
1 parent 05a45db commit 0041ee6

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

SequenceAnalysis/src/org/labkey/sequenceanalysis/SequenceAnalysisController.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4152,25 +4152,27 @@ public ApiResponse execute(ImportOutputFilesForm form, BindException errors) thr
41524152
}
41534153

41544154
Map<String, Object> params = new CaseInsensitiveHashMap<>();
4155-
if (o.get("name") == null)
4155+
if (o.isNull("name"))
41564156
{
41574157
errors.reject(ERROR_MSG, "Missing name for file: " + file.getName());
41584158
return null;
41594159
}
41604160

4161-
if (o.get("libraryId") == null)
4161+
if (o.isNull("libraryId"))
41624162
{
41634163
errors.reject(ERROR_MSG, "Missing genome Id for file: " + file.getName());
41644164
return null;
41654165
}
41664166

41674167
params.put("name", o.getString("name"));
4168-
params.put("description", o.getString("description"));
4168+
params.put("description", o.optString("description"));
41694169

4170-
params.put("library_id", o.getInt("libraryId"));
4171-
if (StringUtils.trimToNull(o.getString("readset")) != null)
4170+
params.put("library_id", o.optInt("libraryId"));
4171+
if (!o.isNull("readset") && StringUtils.trimToNull(o.optString("readset")) != null)
4172+
{
41724173
params.put("readset", o.getInt("readset"));
4173-
params.put("category", o.getString("category"));
4174+
}
4175+
params.put("category", o.optString("category"));
41744176

41754177
params.put("container", getContainer().getId());
41764178
params.put("created", new Date());

0 commit comments

Comments
 (0)