Skip to content

Commit 9715b07

Browse files
committed
fix: check record before publish to bus
1 parent f772478 commit 9715b07

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

vj4/handler/judge.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,8 @@ async def close():
202202
async def reset_record(rid):
203203
rdoc = await record.end_judge(rid, self.user['_id'], self.id,
204204
constant.record.STATUS_WAITING, 0, 0, 0)
205-
bus.publish_throttle('record_change', rdoc, rdoc['_id'])
205+
if rdoc:
206+
bus.publish_throttle('record_change', rdoc, rdoc['_id'])
206207

207208
await asyncio.gather(*[reset_record(rid) for rid in self.rids.values()])
208209
await self.channel.close()

0 commit comments

Comments
 (0)