Skip to content

Commit 8776fdb

Browse files
committed
skip extra check if no versionId supplied #11305
1 parent a6a6255 commit 8776fdb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/java/edu/harvard/iq/dataverse/api/Datasets.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,8 @@ public Response exportDataset(@Context ContainerRequestContext crc, @QueryParam(
259259
return error(BAD_REQUEST, "Unable to look up dataset based on version. Try " + DS_VERSION_LATEST_PUBLISHED + " or " + DS_VERSION_DRAFT + ".");
260260
}
261261

262-
if (!datasetVersion.isDraft()) {
262+
// Trying to get version 1.0 for a dataset that's already at 3.0, for example, is not supported.
263+
if (!datasetVersion.isDraft() && versionId != null) {
263264
Command<DatasetVersion> cmd = new GetLatestPublishedDatasetVersionCommand(dvRequestService.getDataverseRequest(), dataset);
264265
DatasetVersion latestPublishedVersion = commandEngine.submit(cmd);
265266
if (latestPublishedVersion == null) {

0 commit comments

Comments
 (0)