Fix a case where lazily initialized conversation context can throw NPE.
@@ -109,10 +109,12 @@ public abstract class AbstractBoundContext<S> extends AbstractManagedContext imp
@Override
public void clearAndSet(Collection<ContextualInstance<?>> setOfInstances) {
- // bound context can be multithreaded, in such case we perform locking
BoundBeanStore boundBeanStore = getBeanStore();
+ // for instance lazily initialized conversation scope may be active but have null here
+ if (boundBeanStore != null) {
boundBeanStore.clear();
for (ContextualInstance<?> contextualInstance : setOfInstances) {
+ // bound context can be multithreaded, in such case we perform locking
BeanIdentifier id = getId(contextualInstance.getContextual());
LockedBean lock = null;
try {
@@ -128,3 +130,4 @@ public abstract class AbstractBoundContext<S> extends AbstractManagedContext imp
}
}
}
+}
