Skip to content

Commit

Permalink
nullpointer fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ErykKul committed Mar 27, 2024
1 parent 797bc38 commit 0769ee9
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/main/java/edu/harvard/iq/dataverse/DatasetPage.java
Original file line number Diff line number Diff line change
Expand Up @@ -791,14 +791,16 @@ public boolean isIndexedVersion() {
}
// If this is the latest published version, we want to confirm that this
// version was successfully indexed after the last publication
// We add 3 hours to the indexed time to prevent false negatives
// when indexed time gets overwritten in finalizing the publication step
// by a value before the release time
final long duration = 3 * 60 * 60 * 1000;
final Timestamp movedIndexTime = new Timestamp(workingVersion.getDataset().getIndexTime().getTime() + duration);
if (isThisLatestReleasedVersion()) {
return isIndexedVersion = (workingVersion.getDataset().getIndexTime() != null)
&& movedIndexTime.after(workingVersion.getReleaseTime());
if (workingVersion.getDataset().getIndexTime() == null) {
return isIndexedVersion = false;
}
// We add 3 hours to the indexed time to prevent false negatives
// when indexed time gets overwritten in finalizing the publication step
// by a value before the release time
final long duration = 3 * 60 * 60 * 1000;
final Timestamp movedIndexTime = new Timestamp(workingVersion.getDataset().getIndexTime().getTime() + duration);
return isIndexedVersion = movedIndexTime.after(workingVersion.getReleaseTime());
}

// Drafts don't have the indextime stamps set/incremented when indexed,
Expand Down

0 comments on commit 0769ee9

Please sign in to comment.