diff options
| author | jason | 2016-09-06 18:51:55 -0600 |
|---|---|---|
| committer | jason | 2016-09-06 18:51:55 -0600 |
| commit | 1c32c15f9ee3205e2ace312642b0a8832f672ab8 (patch) | |
| tree | c150114f4ff817fc82de5f62e595cb7fe6238ba6 /warmachine/addons/standup.py | |
| parent | 2497a398a916fdacf5540ca6a2c60fc3c8d29e7f (diff) | |
| download | warmachine-ng-1c32c15f9ee3205e2ace312642b0a8832f672ab8.tar.gz warmachine-ng-1c32c15f9ee3205e2ace312642b0a8832f672ab8.zip | |
Fix crash when trying to cancel canceled pester task
- If we try to cancel a pester task that was already canceled and set to
none an AttributeError might be raised trying to call `cancel()` on
None. This fix makes sure that pester_task isn't None before canceling.
Diffstat (limited to '')
| -rw-r--r-- | warmachine/addons/standup.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/warmachine/addons/standup.py b/warmachine/addons/standup.py index 15281f5..2a468f4 100644 --- a/warmachine/addons/standup.py +++ b/warmachine/addons/standup.py | |||
| @@ -73,7 +73,7 @@ class StandUpPlugin(WarMachinePlugin): | |||
| 73 | 73 | ||
| 74 | for_channels = data['for_channels'] | 74 | for_channels = data['for_channels'] |
| 75 | 75 | ||
| 76 | if 'pester_task' in data: | 76 | if 'pester_task' in data and data['pester_task']: |
| 77 | self.log.debug('Stopping pester for {}'.format(user_nick)) | 77 | self.log.debug('Stopping pester for {}'.format(user_nick)) |
| 78 | data['pester_task'].cancel() | 78 | data['pester_task'].cancel() |
| 79 | data['pester_task'] = None | 79 | data['pester_task'] = None |