Skip to content

Commit

Permalink
#4139 fix create DS error
Browse files Browse the repository at this point in the history
  • Loading branch information
sekmiller committed Nov 2, 2017
1 parent 0ec3cee commit 08fd6f6
Showing 1 changed file with 19 additions and 16 deletions.
35 changes: 19 additions & 16 deletions src/main/java/edu/harvard/iq/dataverse/DatasetPage.java
Original file line number Diff line number Diff line change
Expand Up @@ -2666,12 +2666,14 @@ public boolean isStillLocked() {


public boolean isStillLockedForIngest() {
Dataset testDataset = datasetService.find(dataset.getId());
if (testDataset != null && testDataset.getId() != null) {
logger.log(Level.FINE, "checking lock status of dataset {0}", dataset.getId());

if (testDataset.getLockFor(DatasetLock.Reason.Ingest) != null) {
return true;
if (dataset.getId() != null) {
Dataset testDataset = datasetService.find(dataset.getId());
if (testDataset != null && testDataset.getId() != null) {
logger.log(Level.FINE, "checking lock status of dataset {0}", dataset.getId());

if (testDataset.getLockFor(DatasetLock.Reason.Ingest) != null) {
return true;
}
}
}
return false;
Expand All @@ -2690,16 +2692,17 @@ public boolean isLocked() {
return false;
}

public boolean isLockedForIngest(){

Dataset testDataset = datasetService.find(dataset.getId());
if (stateChanged) {
return false;
}

if (testDataset != null) {
if (testDataset.getLockFor(DatasetLock.Reason.Ingest) != null) {
return true;
public boolean isLockedForIngest() {
if (dataset.getId() != null) {
Dataset testDataset = datasetService.find(dataset.getId());
if (stateChanged) {
return false;
}

if (testDataset != null) {
if (testDataset.getLockFor(DatasetLock.Reason.Ingest) != null) {
return true;
}
}
}
return false;
Expand Down

0 comments on commit 08fd6f6

Please sign in to comment.