openhab/org.openhab.binding.zigbee

NPE in ZigbeeIsAliveTracker

Closed this issue · 0 comments

The NPE is not logged and appears only on the console

Exception in thread "pool-116-thread-77" java.lang.NullPointerException
	at org.openhab.binding.zigbee.handler.ZigbeeIsAliveTracker.scheduleTask(ZigbeeIsAliveTracker.java:62)
	at org.openhab.binding.zigbee.handler.ZigbeeIsAliveTracker.resetTimer(ZigbeeIsAliveTracker.java:56)
	at org.openhab.binding.zigbee.handler.ZigBeeThingHandler.setChannelState(ZigBeeThingHandler.java:764)
	at org.openhab.binding.zigbee.converter.ZigBeeBaseChannelConverter.updateChannelState(ZigBeeBaseChannelConverter.java:272)
	at org.openhab.binding.zigbee.internal.converter.ZigBeeConverterColorTemperature.attributeUpdated(ZigBeeConverterColorTemperature.java:194)
	at com.zsmartsystems.zigbee.zcl.ZclCluster$4.run(ZclCluster.java:1046)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)

The exception is thrown by this statement because the specific handler isn't yet in the map

    private void scheduleTask(ZigBeeThingHandler handler) {
            ...
            int interval = handlerIntervalMapping.get(handler);
            ...
    }

I will create a PR which checks if the map contains the handler.