Skip to content

Commit

Permalink
#7176 add testing for null host DV on DS Create
Browse files Browse the repository at this point in the history
  • Loading branch information
sekmiller committed Aug 11, 2020
1 parent 3029502 commit 263a013
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
15 changes: 13 additions & 2 deletions src/main/java/edu/harvard/iq/dataverse/DatasetPage.java
Original file line number Diff line number Diff line change
Expand Up @@ -1270,6 +1270,9 @@ public boolean canUpdateDataset() {
return permissionsWrapper.canUpdateDataset(dvRequestService.getDataverseRequest(), this.dataset);
}
public boolean canPublishDataverse() {
if (dataset.getOwner() == null){
return false;
}
return permissionsWrapper.canIssuePublishDataverseCommand(dataset.getOwner());
}

Expand Down Expand Up @@ -1623,6 +1626,9 @@ private void updateDatasetFieldInputLevels() {
*
*/
private void updateDatasetFieldInputLevels() {
if(dataset.getOwner() == null){
return;
}
Long dvIdForInputLevel = ownerId;

// OPTIMIZATION (?): replaced "dataverseService.find(ownerId)" with
Expand Down Expand Up @@ -1864,7 +1870,9 @@ private String init(boolean initFull) {
//retrieveDatasetVersionResponse = datasetVersionService.retrieveDatasetVersionByVersionId(versionId);

}
this.maxFileUploadSizeInBytes = systemConfig.getMaxFileUploadSizeForStore(dataset.getOwner().getEffectiveStorageDriverId());
if (dataset.getOwner() != null) {
this.maxFileUploadSizeInBytes = systemConfig.getMaxFileUploadSizeForStore(dataset.getOwner().getEffectiveStorageDriverId());
}


if (retrieveDatasetVersionResponse == null) {
Expand Down Expand Up @@ -3948,12 +3956,15 @@ public boolean releaseDraftPopup(){

public boolean publishDatasetPopup(){
if (!dataset.isReleased()) {
return dataset.getOwner().isReleased();
return dataset.getOwner() != null && dataset.getOwner().isReleased();
}
return false;
}

public boolean publishBothPopup() {
if (dataset.getOwner() == null){
return false;
}
if (!dataset.getOwner().isReleased()) {
if (canPublishDataverse()) {
if (dataset.getOwner().getOwner() == null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3082,7 +3082,8 @@ public boolean rsyncUploadSupported() {
// ToDo - rsync was written before multiple store support and currently is hardcoded to use the "s3" store.
// When those restrictions are lifted/rsync can be configured per store, this test should check that setting
// instead of testing for the 's3" store.
return settingsWrapper.isRsyncUpload() && dataset.getDataverseContext().getEffectiveStorageDriverId().equals("s3");
return settingsWrapper.isRsyncUpload() && dataset.getDataverseContext() != null &&
dataset.getDataverseContext().getEffectiveStorageDriverId().equals("s3");
}


Expand Down

0 comments on commit 263a013

Please sign in to comment.