#10539 fix npe when timeout races with failed completion

Signed-off-by: Ludovic Orban <lorban@bitronix.be>
This commit is contained in:
Ludovic Orban 2023-09-18 14:18:44 +02:00
parent 5025d7c66c
commit e68fd6c16c
1 changed files with 3 additions and 2 deletions

View File

@ -396,10 +396,11 @@ public class HttpChannelState implements HttpChannel, Components
}
// otherwise, if there is no failure listener, then we can fail the callback directly without a double lock
if (_onFailure == null && _request != null)
ChannelRequest request = _request;
if (_onFailure == null && request != null)
{
_failure = Content.Chunk.from(t, true);
return () -> _request._callback.failed(t);
return () -> request._callback.failed(t);
}
}
}