Skip to content

Commit

Permalink
fix: NPE fix
Browse files Browse the repository at this point in the history
  • Loading branch information
novoj committed Feb 7, 2025
1 parent 70b4973 commit 5e0b708
Showing 1 changed file with 11 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -669,15 +669,17 @@ private void emptyRemovalQueue() {
*/
private void removeSessionFromIndexes(long sessionSequenceOrder) {
final SessionDescriptor sessionDescriptor = this.sessionUuidIndex.remove(sessionSequenceOrder);
this.sessionIdIndex.remove(sessionDescriptor.getSessionId());
this.sessionCreationIndex.delete(sessionDescriptor.getCreated());
this.sessionDurationIndex.delete(sessionDescriptor.getMaxDurationInMillis());
this.sessionFetchCountIndex.delete(sessionDescriptor.getMaxFetchCount());
this.sessionBytesFetchedIndex.delete(sessionDescriptor.getMaxBytesFetchedTotal());
for (TrafficRecordingType recordingType : sessionDescriptor.getRecordingTypes()) {
final TransactionalObjectBPlusTree<Long, Long> typeIndex = this.sessionRecordingTypeIndex.get(recordingType);
if (typeIndex != null) {
typeIndex.delete(sessionSequenceOrder);
if (sessionDescriptor != null) {
this.sessionIdIndex.remove(sessionDescriptor.getSessionId());
this.sessionCreationIndex.delete(sessionDescriptor.getCreated());
this.sessionDurationIndex.delete(sessionDescriptor.getMaxDurationInMillis());
this.sessionFetchCountIndex.delete(sessionDescriptor.getMaxFetchCount());
this.sessionBytesFetchedIndex.delete(sessionDescriptor.getMaxBytesFetchedTotal());
for (TrafficRecordingType recordingType : sessionDescriptor.getRecordingTypes()) {
final TransactionalObjectBPlusTree<Long, Long> typeIndex = this.sessionRecordingTypeIndex.get(recordingType);
if (typeIndex != null) {
typeIndex.delete(sessionSequenceOrder);
}
}
}
}
Expand Down

0 comments on commit 5e0b708

Please sign in to comment.