From 755bdaaf40f8c357d73b1db65ef95b6be26c240c Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Tue, 16 Jan 2024 14:58:31 +0100 Subject: Thrift: Avoid creating TWrapper for null-client --- src/main/java/org/openslx/thrifthelper/ThriftHandler.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') 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 implements InvocationHandler } // No usable existing connection, create new client LOGGER.debug( "Creating new thrift client" ); - return new TWrap( clientFactory.getNewClient() ); + T client = clientFactory.getNewClient(); + if ( client == null ) + return null; + return new TWrap( client ); } /** -- cgit v1.2.3-55-g7522