Skip to content

Commit

Permalink
Merge pull request #2355 from telefonicaid/fix/check_get_lastdata_bef…
Browse files Browse the repository at this point in the history
…ore_remove

Fix/check get lastdata before remove
  • Loading branch information
fgalan authored Mar 8, 2024
2 parents 02198b4 + dd60680 commit 93f11cb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGES_NEXT_RELEASE
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- [cygnus-ngsi][ColumnAggregator][LastData] Fix error when remove old values in lastData which does not exist (i.e. creating and updating entities)
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,10 @@ public void aggregate(NGSIEvent event) {
if (storedTS < currentTS) {
ArrayList<String> keys = new ArrayList<>(aggregation.keySet());
for (int j = 0 ; j < keys.size() ; j++) {
lastData.get(keys.get(j)).remove(i);
ArrayList<JsonElement> lst = lastData.get(keys.get(j));
if (lst != null) {
lst.remove(i);
}
}
updateLastData = true;
break;
Expand Down

0 comments on commit 93f11cb

Please sign in to comment.