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>
(cherry picked from commit
1105cf5bc00628ee6dc2d86dce1ef4225050a5ba)
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;
}
}