Elffuss BraidHub

kikocis/java-driver public

Fix NPE on uninitialized session.
Changeset2529393d30136072be16d1a159542c1f3f8f3378c004729b23dc90fff5f6f717
Authorolim7t <omichallat+github@gmail.com> · 2016-05-10 09:42 -07:00
Committerolim7t <omichallat+github@gmail.com> · 2016-05-10 09:42 -07:00
Parentsb0c37523b22c

Browse the files at this changeset

1 file changed

modified driver-core/src/main/java/com/datastax/driver/core/SessionManager.java +3 −2
@@ -617,9 +617,10 @@
617617
618618 @Override
619619 protected void checkNotInEventLoop() {
620- if (!CHECK_IO_DEADLOCKS)
620+ Connection.Factory connectionFactory = cluster.manager.connectionFactory;
621+ if (!CHECK_IO_DEADLOCKS || connectionFactory == null)
621622 return;
622- for (EventExecutor executor : cluster.manager.connectionFactory.eventLoopGroup) {
623+ for (EventExecutor executor : connectionFactory.eventLoopGroup) {
623624 if (executor.inEventLoop()) {
624625 throw new IllegalStateException(
625626 "Detected a synchronous Session call (execute() or prepare()) on an I/O thread, " +