File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed
EasyRest/src/main/java/tech/dbgsoftware/easyrest Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -50,6 +50,8 @@ public Request(FullHttpRequest fullHttpRequest) {
5050 }
5151 }));
5252 }
53+ } catch (Exception e ) {
54+ LogUtils .error ("Ref count = " + fullHttpRequest .refCnt () + " " + e .getMessage ());
5355 } finally {
5456 fullHttpRequest .release ();
5557 }
Original file line number Diff line number Diff line change @@ -243,15 +243,18 @@ private void registerUserHandlers(ChannelPipeline pipeline){
243243 userHandlers .forEach ((name , handler ) -> {
244244 Function <Map <String , Boolean >, ChannelHandler > handlerPredicate = newHandler -> {
245245 try {
246- if (!newHandler .get (name )) {
246+ if (newHandler != null && handler != null && !newHandler .get (name )) {
247247 return handler .getClass ().newInstance ();
248248 }
249249 } catch (InstantiationException | IllegalAccessException e ) {
250250 LOGGER .error (e .getMessage (), e );
251251 }
252252 return handler ;
253253 };
254- pipeline .addLast (workerEventLoopGroup , handlerPredicate .apply (isSharableMapping ));
254+ ChannelHandler channelHandler = handlerPredicate .apply (isSharableMapping );
255+ if (channelHandler != null ) {
256+ pipeline .addLast (workerEventLoopGroup , channelHandler );
257+ }
255258 });
256259 }
257260 }
You can’t perform that action at this time.
0 commit comments