Fix possible FFmpegAudio AttributeError in __del__

This commit is contained in:
Imayhaveborkedit 2023-09-20 17:13:50 -04:00 committed by GitHub
parent 97ae6409b0
commit dacf3cfe86
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -212,7 +212,8 @@ class FFmpegAudio(AudioSource):
return process
def _kill_process(self) -> None:
proc = self._process
# this function gets called in __del__ so instance attributes might not even exist
proc = getattr(self, '_process', MISSING)
if proc is MISSING:
return