anton-johansson / e-home

An E-Home controller server.
Apache License 2.0
1 stars 0 forks source link

NPE when reading device update #26

Closed anton-johansson closed 6 years ago

anton-johansson commented 6 years ago

If we are monitoring a value and we receive a device's first update, the device might not yet have any metric. That means, the currentValue might be null.

Stacktrace:

2018-02-22 18:57:53,005 ERROR com.whizzosoftware.wzwave.channel.ZWaveChannelInboundHandler:81 - An exception occurred
java.lang.NullPointerException
    at com.anton.ehome.zwave.Controller$Listener.onZWaveNodeUpdated(Controller.java:166)
    at com.whizzosoftware.wzwave.controller.netty.NettyZWaveController.onZWaveNodeUpdated(NettyZWaveController.java:271)
    at com.whizzosoftware.wzwave.controller.netty.NettyZWaveController.onApplicationCommand(NettyZWaveController.java:396)
    at com.whizzosoftware.wzwave.channel.ZWaveChannelInboundHandler.channelRead(ZWaveChannelInboundHandler.java:56)
    at com.whizzosoftware.wzwave.channel.ZWaveChannelInboundHandler.userEventTriggered(ZWaveChannelInboundHandler.java:94)
    at io.netty.channel.AbstractChannelHandlerContext.invokeUserEventTriggered(AbstractChannelHandlerContext.java:304)
    at io.netty.channel.AbstractChannelHandlerContext.fireUserEventTriggered(AbstractChannelHandlerContext.java:290)
    at com.whizzosoftware.wzwave.channel.TransactionInboundHandler$NettyZWaveChannelContext.process(TransactionInboundHandler.java:171)
    at com.whizzosoftware.wzwave.channel.TransactionInboundHandler.channelRead(TransactionInboundHandler.java:66)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319)
    at com.whizzosoftware.wzwave.channel.FrameQueueHandler.channelRead(FrameQueueHandler.java:239)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319)
    at com.whizzosoftware.wzwave.channel.ACKInboundHandler.channelRead(ACKInboundHandler.java:33)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319)
    at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:163)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319)
    at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:787)
    at io.netty.channel.oio.AbstractOioByteChannel.doRead(AbstractOioByteChannel.java:147)
    at io.netty.channel.oio.AbstractOioChannel$1.run(AbstractOioChannel.java:45)
    at io.netty.channel.ThreadPerChannelEventLoop.run(ThreadPerChannelEventLoop.java:53)
    at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116)
    at java.lang.Thread.run(Thread.java:748)