From a84a13c76d99f1e6f4505d43108a4111749e5035 Mon Sep 17 00:00:00 2001 From: AAGaming Date: Sat, 25 May 2024 19:14:54 -0400 Subject: Custom error handler and some misc fixes --- backend/decky_loader/plugin/plugin.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'backend/decky_loader/plugin/plugin.py') diff --git a/backend/decky_loader/plugin/plugin.py b/backend/decky_loader/plugin/plugin.py index 00b5dad8..75e52c6a 100644 --- a/backend/decky_loader/plugin/plugin.py +++ b/backend/decky_loader/plugin/plugin.py @@ -99,8 +99,10 @@ class PluginWrapper: return self def stop(self, uninstall: bool = False): - self._listener_task.cancel() + if hasattr(self, "_listener_task"): + self._listener_task.cancel() async def _(self: PluginWrapper): - await self._socket.write_single_line(dumps({ "stop": True, "uninstall": uninstall }, ensure_ascii=False)) - await self._socket.close_socket_connection() + if hasattr(self, "_socket"): + await self._socket.write_single_line(dumps({ "stop": True, "uninstall": uninstall }, ensure_ascii=False)) + await self._socket.close_socket_connection() create_task(_(self)) \ No newline at end of file -- cgit v1.2.3