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
Of course this is only a problem for empty files otherwise a non-null chunk is returned and subsequent reads in the ChunkedWriteHandler are correctly guarded by the isEndOfInput check.
This problem also occurs with ChunkedNioStream.
java.lang.NullPointerException: msg
at io.netty.channel.DefaultChannelHandlerContext.write(DefaultChannelHandlerContext.java:674)
at io.netty.channel.DefaultChannelHandlerContext.write(DefaultChannelHandlerContext.java:668)
at io.netty.handler.stream.ChunkedWriteHandler.doFlush(ChunkedWriteHandler.java:260)
at io.netty.handler.stream.ChunkedWriteHandler.flush(ChunkedWriteHandler.java:145)
at io.netty.channel.DefaultChannelHandlerContext.invokeFlush0(DefaultChannelHandlerContext.java:730)
at io.netty.channel.DefaultChannelHandlerContext.invokeFlush(DefaultChannelHandlerContext.java:713)
at io.netty.channel.DefaultChannelHandlerContext.flush(DefaultChannelHandlerContext.java:706)
at com.tantaman.ferox.priv.Response$FineGrainedControl.write(Response.java:253)
at com.tantaman.ferox.remotestorage.route_handlers.ReadRouteHandler.returnDocument(ReadRouteHandler.java:133)
at com.tantaman.ferox.remotestorage.route_handlers.ReadRouteHandler.respondWithResource(ReadRouteHandler.java:89)
at com.tantaman.ferox.remotestorage.route_handlers.ReadRouteHandler.access$2(ReadRouteHandler.java:85)
at com.tantaman.ferox.remotestorage.route_handlers.ReadRouteHandler$2.run(ReadRouteHandler.java:76)
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:353)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:366)
at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:101)
at java.lang.Thread.run(Thread.java:722)
The text was updated successfully, but these errors were encountered:
Using
ChunkedStream
to read an empty file andChunkedWriteHandler
to write it to a channel results in a null pointer exception.It appears that the problem is that
ChunkedStream
returns null once it reaches the end of the stream: https://github.com/netty/netty/blob/netty-4.0.2.Final/handler/src/main/java/io/netty/handler/stream/ChunkedStream.java#L99and
ChunkedWriteHandler
then attempts to write the null message to the channel: https://github.com/netty/netty/blob/netty-4.0.2.Final/handler/src/main/java/io/netty/handler/stream/ChunkedWriteHandler.java#L260Of course this is only a problem for empty files otherwise a non-null chunk is returned and subsequent reads in the
ChunkedWriteHandler
are correctly guarded by theisEndOfInput
check.This problem also occurs with
ChunkedNioStream
.The text was updated successfully, but these errors were encountered: