fix conditional on task_no_item

This commit is contained in:
Kevin Lloyd Bernal 2023-07-18 20:49:33 +08:00
parent 3f5bbe3a8f
commit 2f787a27dc
1 changed files with 1 additions and 1 deletions

View File

@ -84,7 +84,7 @@ class CloseSpider:
task.cancel()
task_no_item = getattr(self, "task_no_item", False)
if task_no_item.running:
if task_no_item and task_no_item.running:
task_no_item.stop()
def spider_opened_no_item(self, spider):