diff --git a/webmagic-core/src/main/java/us/codecraft/webmagic/Spider.java b/webmagic-core/src/main/java/us/codecraft/webmagic/Spider.java index a35af70af..e47a61f22 100644 --- a/webmagic-core/src/main/java/us/codecraft/webmagic/Spider.java +++ b/webmagic-core/src/main/java/us/codecraft/webmagic/Spider.java @@ -187,7 +187,7 @@ public Spider scheduler(Scheduler scheduler) { */ public Spider setScheduler(Scheduler updateScheduler) { checkIfRunning(); - SpiderScheduler oldScheduler = this.scheduler; + Scheduler oldScheduler = scheduler.getScheduler(); scheduler.setScheduler(updateScheduler); if (oldScheduler != null) { Request request;