File tree 1 file changed +5
-10
lines changed
src/main/java/edu/harvard/iq/dataverse/util/json
1 file changed +5
-10
lines changed Original file line number Diff line number Diff line change @@ -332,18 +332,13 @@ public Dataset parseDataset(JsonObject obj) throws JsonParseException {
332
332
}else {
333
333
throw new JsonParseException ("Specified metadatalanguage not allowed." );
334
334
}
335
- DatasetType defaultDatasetType = datasetTypeService .getByName (DatasetType .DEFAULT_DATASET_TYPE );
336
- String datasetTypeIn = obj .getString ("datasetType" , null );
335
+ String datasetTypeIn = obj .getString ("datasetType" , DatasetType .DEFAULT_DATASET_TYPE );
337
336
logger .fine ("datasetTypeIn: " + datasetTypeIn );
338
- if (datasetTypeIn == null ) {
339
- dataset .setDatasetType (defaultDatasetType );
337
+ DatasetType datasetType = datasetTypeService .getByName (datasetTypeIn );
338
+ if (datasetType != null ) {
339
+ dataset .setDatasetType (datasetType );
340
340
} else {
341
- DatasetType datasetType = datasetTypeService .getByName (datasetTypeIn );
342
- if (datasetType != null ) {
343
- dataset .setDatasetType (datasetType );
344
- } else {
345
- throw new JsonParseException ("Invalid dataset type: " + datasetTypeIn );
346
- }
341
+ throw new JsonParseException ("Invalid dataset type: " + datasetTypeIn );
347
342
}
348
343
349
344
DatasetVersion dsv = new DatasetVersion ();
You can’t perform that action at this time.
0 commit comments