fix(src/window/controlcenter): add guard for destroyed state and adjust return value
This commit is contained in:
1 file changed
+6
-1
@@ -193,6 +193,9 @@ class PerAppVolumeControl(Box):
|
|||||||
|
|
||||||
def _populate_apps(self):
|
def _populate_apps(self):
|
||||||
"""Populate the widget with current audio applications"""
|
"""Populate the widget with current audio applications"""
|
||||||
|
if self._destroyed:
|
||||||
|
return False
|
||||||
|
|
||||||
from utils.functions import clear_children
|
from utils.functions import clear_children
|
||||||
|
|
||||||
clear_children(self.apps_container)
|
clear_children(self.apps_container)
|
||||||
@@ -202,7 +205,7 @@ class PerAppVolumeControl(Box):
|
|||||||
# Use fabric audio service for applications
|
# Use fabric audio service for applications
|
||||||
if not audio_service:
|
if not audio_service:
|
||||||
self._show_no_apps_message()
|
self._show_no_apps_message()
|
||||||
return
|
return None
|
||||||
|
|
||||||
applications = getattr(audio_service, "applications", [])
|
applications = getattr(audio_service, "applications", [])
|
||||||
|
|
||||||
@@ -230,6 +233,8 @@ class PerAppVolumeControl(Box):
|
|||||||
else:
|
else:
|
||||||
self._show_no_apps_message()
|
self._show_no_apps_message()
|
||||||
|
|
||||||
|
return False
|
||||||
|
|
||||||
def _show_no_apps_message(self):
|
def _show_no_apps_message(self):
|
||||||
"""Show message when no apps are playing audio"""
|
"""Show message when no apps are playing audio"""
|
||||||
message = Label(
|
message = Label(
|
||||||
|
|||||||
Reference in new issue
Block a user