http2: fix nil dereference after Read completes with an error

Case happens if Read is called after it has already returned an error
previously. Verified that the new TestPipeCloseWithError test fails
before this change but passes after.

Updates golang/go#20501

Change-Id: I636fbb194f2d0019b0722556cc25a88da2d18e13
Run-TryBot: Tom Bergan <>
TryBot-Result: Gobot Gobot <>
Reviewed-by: Brad Fitzpatrick <>
2 files changed