NullPointerException in ZigBeeThingHandler.dispose() on Delete Thing in GUI

I get this error consistently every time when I delete a ZigBee thing in Paper UI. As you can see, it’s one type of error and two types of warnings. The warnings can occur long after item deletion. Therefore, the only way to clean the logs, is to restart openhab.
I’m hoping, this is easy to fix.
The system is running OH 3.4 stable on RPI 4.

2023-01-03 15:11:42.084 [ERROR] [org.openhab.core.thing.internal.ThingManagerImpl  ] - Exception occurred while disposing handler of thing 'zigbee:device:local:a4c13873ed3378fd': null
java.lang.NullPointerException: null
        at org.openhab.binding.zigbee.handler.ZigBeeThingHandler.getOtaServer( ~[?:?]
        at org.openhab.binding.zigbee.handler.ZigBeeThingHandler.dispose( ~[?:?]
        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke( ~[?:?]
        at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke( ~[?:?]
        at java.lang.reflect.Method.invoke( ~[?:?]
        at org.openhab.core.internal.common.AbstractInvocationHandler.invokeDirect( [bundleFile:?]
        at [bundleFile:?]
        at [?:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker( [?:?]
        at java.util.concurrent.ThreadPoolExecutor$ [?:?]
        at [?:?]
2023-01-03 15:13:27.700 [WARN ] [org.openhab.core.thing.binding.BaseThingHandler   ] - Handler ZigBeeThingHandler tried updating its thing's properties although the handler was already disposed.
2023-01-03 15:21:34.066 [WARN ] [org.openhab.core.thing.binding.BaseThingHandler   ] - Handler ZigBeeThingHandler of thing zigbee:device:local:a4c13873ed3378fd tried checking if channel A4C13873ED3378FD_1_vibration is linked although the handler was already disposed.

I’ve created a PR that will hopefully fix this -:

1 Like