@@ -120,7 +120,7 @@ private Map<Class, AddFilterAdaptor> getAddFilters(
120120 for (KubernetesReconcilerWatch watch : watches .value ()) {
121121 for (Method method : reconciler .getClass ().getMethods ()) {
122122 AddWatchEventFilter annotation = method .getAnnotation (AddWatchEventFilter .class );
123- if (watch .apiTypeClass ().equals (annotation .apiTypeClass ())) {
123+ if (annotation != null && watch .apiTypeClass ().equals (annotation .apiTypeClass ())) {
124124 if (filters .containsKey (watch .apiTypeClass ())) {
125125 log .warn (
126126 "Duplicated watch ADD event filter upon apiType {}" , annotation .apiTypeClass ());
@@ -146,7 +146,7 @@ private Map<Class, UpdateFilterAdaptor> getUpdateFilters(
146146 for (KubernetesReconcilerWatch watch : watches .value ()) {
147147 for (Method method : reconciler .getClass ().getMethods ()) {
148148 UpdateWatchEventFilter annotation = method .getAnnotation (UpdateWatchEventFilter .class );
149- if (watch .apiTypeClass ().equals (annotation .apiTypeClass ())) {
149+ if (annotation != null && watch .apiTypeClass ().equals (annotation .apiTypeClass ())) {
150150 if (filters .containsKey (watch .apiTypeClass ())) {
151151 log .warn (
152152 "Duplicated watch UPDATE event filter upon apiType {}" , annotation .apiTypeClass ());
@@ -173,7 +173,7 @@ private Map<Class, DeleteFilterAdaptor> getDeleteFilters(
173173 for (KubernetesReconcilerWatch watch : watches .value ()) {
174174 for (Method method : reconciler .getClass ().getMethods ()) {
175175 DeleteWatchEventFilter annotation = method .getAnnotation (DeleteWatchEventFilter .class );
176- if (watch .apiTypeClass ().equals (annotation .apiTypeClass ())) {
176+ if (annotation != null && watch .apiTypeClass ().equals (annotation .apiTypeClass ())) {
177177 if (filters .containsKey (watch .apiTypeClass ())) {
178178 log .warn (
179179 "Duplicated watch DELETE event filter upon apiType {}" , annotation .apiTypeClass ());
0 commit comments