diff --git a/src/java/org/apache/nutch/searcher/LuceneQueryOptimizer.java b/src/java/org/apache/nutch/searcher/LuceneQueryOptimizer.java index 57a8371130..f6311ba657 100644 --- a/src/java/org/apache/nutch/searcher/LuceneQueryOptimizer.java +++ b/src/java/org/apache/nutch/searcher/LuceneQueryOptimizer.java @@ -104,8 +104,10 @@ public LimitedCollector(int numHits, int maxHits, int maxTicks, super(numHits); this.maxHits = maxHits; this.maxTicks = maxTicks; - this.timer = timer; - this.startTicks = timer.timeCounter; + if (timer != null) { + this.timer = timer; + this.startTicks = timer.timeCounter; + } } public void collect(int doc, float score) {