Handle NPE while deleted index not exist in indexMap
@@ -588,6 +588,7 @@ public class IndexEventHolder implements IndexedEventHolder, Serializable {
TreeMap<Object, Set<StreamEvent>> indexMap = indexData.get(indexEntry.getKey());
Object key = deletedEvent.getOutputData()[indexEntry.getValue()];
Set<StreamEvent> values = indexMap.get(key);
+ if (values != null) {
values.remove(deletedEvent);
if (values.size() == 0) {
indexMap.remove(key);
@@ -596,6 +597,7 @@ public class IndexEventHolder implements IndexedEventHolder, Serializable {
}
}
}
+ }
private void deleteFromIndexes(StreamEvent toDeleteEvent) {
if (indexMetaData != null) {
@@ -603,6 +605,7 @@ public class IndexEventHolder implements IndexedEventHolder, Serializable {
TreeMap<Object, Set<StreamEvent>> indexMap = indexData.get(indexEntry.getKey());
Object key = toDeleteEvent.getOutputData()[indexEntry.getValue()];
Set<StreamEvent> values = indexMap.get(key);
+ if (values != null) {
values.remove(toDeleteEvent);
if (values.size() == 0) {
indexMap.remove(key);
@@ -610,6 +613,7 @@ public class IndexEventHolder implements IndexedEventHolder, Serializable {
}
}
}
+ }
private boolean isFullSnapshot() {
return operationChangeLog.size() > (eventsCount * FULL_SNAPSHOT_THRESHOLD)
