if (listeners != null) {
notifyListeners(storage, listeners.iterator(), value);
- if (listeners.isEmpty()) {
+ if (listeners != null && listeners.isEmpty()) {
listeners = null;
}
}
it.remove();
}
}
- if (predicateListeners.isEmpty()) {
+ if (predicateListeners != null && predicateListeners.isEmpty()) {
predicateListeners = null;
}
}