=str #15418: Fix NPE when stream is closed before having a connection ac...

I could not reproduce the original reported problem, but this looks like a bug anywyz.

Fixes #15418