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,7 +222,8 @@ class PanClient(AsyncClient):
async def send_message(self, message):
"""Send a thread message to the UI thread."""
await self.queue.put(message)
if self.queue:
await self.queue.put(message)
async def send_update_devices(self, devices):
"""Send a dictionary of devices to the UI thread."""

View File

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