Skip to content

Commit c438fc9

Browse files
author
minecraft server
committed
Fixed bug in schedule where only one event could be keyless at once.
1 parent baa4724 commit c438fc9

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

plugins/schedule.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,11 @@ def register(timeout, callback, key=None):
1414
If key is given, it will replace an old timeout (if any) with the same key.
1515
"""
1616

17-
try:
18-
clear(key)
19-
except KeyError:
20-
pass
17+
if key is not None:
18+
try:
19+
clear(key)
20+
except KeyError:
21+
pass
2122

2223
new_time = time.time() + timeout
2324
for i in range(len(events)):

0 commit comments

Comments
 (0)