mirror of
https://github.com/Steffo99/greed.git
synced 2024-11-22 05:54:18 +00:00
#3: Do not crash if a CancelSignal is sent to a non-cancellable wait
This commit is contained in:
parent
6680797a72
commit
575ca37033
1 changed files with 7 additions and 3 deletions
|
@ -125,9 +125,13 @@ class ChatWorker(threading.Thread):
|
||||||
# Get the next update
|
# Get the next update
|
||||||
update = self.__receive_next_update()
|
update = self.__receive_next_update()
|
||||||
# Ensure the update isn't a CancelSignal
|
# Ensure the update isn't a CancelSignal
|
||||||
if cancellable and isinstance(update, CancelSignal):
|
if isinstance(update, CancelSignal):
|
||||||
|
if cancellable:
|
||||||
# Return the CancelSignal
|
# Return the CancelSignal
|
||||||
return update
|
return update
|
||||||
|
else:
|
||||||
|
# Ignore the signal
|
||||||
|
continue
|
||||||
# Ensure the update contains a message
|
# Ensure the update contains a message
|
||||||
if update.message is None:
|
if update.message is None:
|
||||||
continue
|
continue
|
||||||
|
|
Loading…
Reference in a new issue