From 89edd10dc2825e51fa0cc8a10567f923932974e4 Mon Sep 17 00:00:00 2001 From: Jerry Yan <792602257@qq.com> Date: Fri, 1 Feb 2019 16:44:38 +0800 Subject: [PATCH] Emeg Fix : While Lottery is None , Program will crash --- api.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/api.py b/api.py index c461482..841d957 100644 --- a/api.py +++ b/api.py @@ -189,9 +189,10 @@ class XiGuaLiveApi: self.onLike(User(i)) else: pass - self.lottery = Lottery(i) + if self.lottery is None or self.lottery.ID == 0: + self.lottery = Lottery(i) self._updRoomCount += 1 - if self.lottery is not None or self.lottery.ID != 0: + if self.lottery is not None and self.lottery.ID != 0: self.lottery.update() if self.lottery.isFinished: self.onLottery(self.lottery) @@ -204,7 +205,6 @@ class XiGuaLiveApi: if __name__ == "__main__": name = "永恒de草薙" - # name = "尤美" if len(sys.argv) > 2: if sys.argv[-1] == "d": DEBUG = True