Skip to content

Commit 72c1813

Browse files
Check if process is running before killing
1 parent 74c549a commit 72c1813

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

amplipi/streams/airplay.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,10 +149,11 @@ def _deactivate(self):
149149
self.proc.kill()
150150
self.proc.communicate()
151151

152-
self.volume_process.terminate()
153-
if self.volume_process.wait(1) != 0:
154-
logger.info('killing shairport vol sync')
155-
self.volume_process.kill()
152+
if self.volume_process is not None:
153+
self.volume_process.terminate()
154+
if self.volume_process.wait(1) != 0:
155+
logger.info('killing shairport vol sync')
156+
self.volume_process.kill()
156157
if '_log_file' in self.__dir__() and self._log_file:
157158
self._log_file.close()
158159
if self.src:

0 commit comments

Comments
 (0)