diff options
-rw-r--r-- | src/main/java/org/openslx/thrifthelper/ThriftHandler.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/main/java/org/openslx/thrifthelper/ThriftHandler.java b/src/main/java/org/openslx/thrifthelper/ThriftHandler.java index e73c0ec..37c2897 100644 --- a/src/main/java/org/openslx/thrifthelper/ThriftHandler.java +++ b/src/main/java/org/openslx/thrifthelper/ThriftHandler.java @@ -176,7 +176,10 @@ class ThriftHandler<T extends TServiceClient> implements InvocationHandler } // No usable existing connection, create new client LOGGER.debug( "Creating new thrift client" ); - return new TWrap<T>( clientFactory.getNewClient() ); + T client = clientFactory.getNewClient(); + if ( client == null ) + return null; + return new TWrap<T>( client ); } /** |