pantalaimon: Only send UI messages if there is a queue.

This commit is contained in:
Damir Jelić 2019-07-12 14:47:51 +02:00
parent ad65fbf1a7
commit b9d518fad8
2 changed files with 4 additions and 2 deletions

View file

@ -222,6 +222,7 @@ class PanClient(AsyncClient):
async def send_message(self, message): async def send_message(self, message):
"""Send a thread message to the UI thread.""" """Send a thread message to the UI thread."""
if self.queue:
await self.queue.put(message) await self.queue.put(message)
async def send_update_devices(self, devices): async def send_update_devices(self, devices):

View file

@ -259,6 +259,7 @@ class ProxyDaemon:
async def send_ui_message(self, message): async def send_ui_message(self, message):
"""Send a thread message to the UI thread.""" """Send a thread message to the UI thread."""
if self.send_queue:
await self.send_queue.put(message) await self.send_queue.put(message)
async def receive_message(self, message): async def receive_message(self, message):