From f48d9ad15f9379d808d6553ce18f99894a32cca5 Mon Sep 17 00:00:00 2001 From: Graeme Rocher Date: Tue, 25 Jun 2019 14:45:30 +0200 Subject: [PATCH] Add null check to isSkippable. Fixes #9278 (#9280) Motivation: Currently GraalVM substrate returns null for reflective calls if the reflection access is not declared up front. A change introduced in Netty 4.1.35 results in needing to register every Netty handler for reflection. This complicates matters as it is difficult to know all the possible handlers that need to be registered. Modification: This change adds a simple null check such that Netty does not break on GraalVM substrate without the reflection information registration. Result: Fixes #9278 --- .../src/main/java/io/netty/channel/ChannelHandlerMask.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/transport/src/main/java/io/netty/channel/ChannelHandlerMask.java b/transport/src/main/java/io/netty/channel/ChannelHandlerMask.java index baa36891ff..8edc4b703e 100644 --- a/transport/src/main/java/io/netty/channel/ChannelHandlerMask.java +++ b/transport/src/main/java/io/netty/channel/ChannelHandlerMask.java @@ -179,7 +179,7 @@ final class ChannelHandlerMask { "Class {} missing method {}, assume we can not skip execution", handlerType, methodName, e); return false; } - return m.isAnnotationPresent(Skip.class); + return m != null && m.isAnnotationPresent(Skip.class); }); }