You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In case the IKEA gateway is unreachable the binding runs into an NPE:
2021-01-01 15:31:32.243 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method 'ThingHandler.initialize()' on 'org.openhab.binding.tradfri.internal.handler.TradfriControllerHandler@6f16b0c4': null
java.lang.NullPointerException: null
at org.eclipse.californium.core.CoapClient.setEndpoint(CoapClient.java:354) ~[?:?]
at org.openhab.binding.tradfri.internal.handler.TradfriThingHandler.initialize(TradfriThingHandler.java:73) ~[?:?]
at jdk.internal.reflect.GeneratedMethodAccessor58.invoke(Unknown Source) ~[?:?]
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
at org.openhab.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:154) [bundleFile:?]
at org.openhab.core.internal.common.Invocation.call(Invocation.java:52) [bundleFile:?]
at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
at java.lang.Thread.run(Thread.java:834) [?:?]
The reason being that handler.getEndpoint() returns null here:
In case the IKEA gateway is unreachable the binding runs into an NPE:
The reason being that
handler.getEndpoint()
returnsnull
here:openhab-addons/bundles/org.openhab.binding.tradfri/src/main/java/org/openhab/binding/tradfri/internal/handler/TradfriThingHandler.java
Lines 67 to 73 in d3ae641
I noticed that the gateway
handler
(bridge) does not have an endpoint if it isOFFLINE
.All happened during the initialization, so after the bridge goes
OFFLINE
the initialization of the handlers is triggered and then runs into the NPE.I will provide a PR that sets the
coapEndpoint
only if the bridge isONLINE
.The text was updated successfully, but these errors were encountered: