Add a missing check in case of close_if_idle on a dead connection.

This commit is contained in:
L. Kärkkäinen 2020-03-02 16:55:48 +02:00
parent 9c21457b58
commit c2e5674a73

View File

@ -192,7 +192,7 @@ class HttpProtocol(asyncio.Protocol):
:return: boolean - True if closed, false if staying open
"""
if self._http.stage is Stage.IDLE:
if self._http is None or self._http.stage is Stage.IDLE:
self.close()
return True
return False