Don't try to shutdown a not running API (#543)

This commit is contained in:
Pascal Vizeli 2018-06-30 22:06:18 +02:00 committed by GitHub
parent 75d24ba534
commit 44ae9c7b63
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -243,5 +243,9 @@ class RestAPI(CoreSysAttributes):
async def stop(self):
"""Stop rest api webserver."""
if not self._site:
return
# Shutdown running API
await self._site.stop()
await self._runner.cleanup()