Skip to content

Commit

Permalink
Merge pull request #228 from InseeFr/fix/null-state-data
Browse files Browse the repository at this point in the history
fix: check state data dates only when non null dates are used
  • Loading branch information
davdarras authored Apr 8, 2024
2 parents a157b73 + 8449bcf commit 52223fb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<description>Modules for queen back-office</description>

<properties>
<revision>4.2.1</revision>
<revision>4.2.2</revision>
<changelist></changelist>
<java.version>21</java.version>
<maven.compiler.source>21</maven.compiler.source>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ public void saveStateData(String surveyUnitId, StateData stateData) throws State
// update only if incoming state-data is newer
Long previousDate = previousStateData.get().date();
Long newDate = stateData.date();
if (newDate.compareTo(previousDate) < 0) {

if (newDate != null && newDate.compareTo(previousDate) < 0) {
throw new StateDataInvalidDateException(INVALID_DATE_MESSAGE);
}
stateDataRepository.save(surveyUnitId, stateData);
Expand Down

0 comments on commit 52223fb

Please sign in to comment.