We may end up in a situation where we trigger multiple times, in
which case we can end up with mutated state and therefore cannot
rely on fields being non-null.
JIRA: YANGTOOLS-1155
Change-Id: I5607843d1e02483faa387a5630f3c4c06a3be62a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
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;
}
}