diff --git a/haffmpeg/tools.py b/haffmpeg/tools.py index 77aa101..414684e 100644 --- a/haffmpeg/tools.py +++ b/haffmpeg/tools.py @@ -52,7 +52,8 @@ async def get_image( return None finally: - await self.close(0) + if self.is_running: + await self.close(0) class FFVersion(HAFFmpeg): @@ -87,6 +88,7 @@ async def get_version(self, timeout: int = 15) -> Optional[str]: self.kill() finally: - await self.close(0) + if self.is_running: + await self.close(0) return None