AggregateEntriesSpaceOperationResult is null in rear condition

Description

As far as we know this issue occurred only once, we do not have an explanation for it. NPE happened on an object we have no control over so I think the problem is in xap code base. Due to the async nature of the aggregate job and not having debug logging enabled we can not tell the exact where clause which was executed. It most likely looked similar to this:

"sessionIds[]=? AND terminationReason IN AND communicationCategory.name IN AND historyEntryViews[](operator.sessionId = ? AND directions[*] IN ) AND tenantId=?"

Log file with complete stacktrace is attached. HistoryEntry and its base class SpaceObject are attached. Also most relevant code which executes the aggregate (SpaceHistoryEntryRepository) is attached. But we think it is not directly related to our code, because query worked every time except once.