Skip to content

Commit

Permalink
nullpointer fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ErykKul committed Jun 26, 2023
1 parent 0cad39a commit 361e754
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/main/java/edu/harvard/iq/dataverse/DatasetPage.java
Original file line number Diff line number Diff line change
Expand Up @@ -2846,10 +2846,15 @@ public String refresh() {

if (persistentId != null) {
setIdByPersistentId();
}
if (dataset.getId() != null) {
//retrieveDatasetVersionResponse = datasetVersionService.retrieveDatasetVersionById(dataset.getId(), version);
dataset = datasetService.findDeep(dataset.getId());
if (this.getId() == null) {
logger.warning("No such dataset: "+persistentId);
return permissionsWrapper.notFound();
}
dataset = datasetService.findDeep(this.getId());
if (dataset == null) {
logger.warning("No such dataset: "+persistentId);
return permissionsWrapper.notFound();
}
retrieveDatasetVersionResponse = datasetVersionService.selectRequestedVersion(dataset.getVersions(), version);
} else if (versionId != null) {
retrieveDatasetVersionResponse = datasetVersionService.retrieveDatasetVersionByVersionId(versionId);
Expand Down

0 comments on commit 361e754

Please sign in to comment.