fix for npe

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@8007 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 13 years ago
parent d260b25457
commit 279482a76d

@ -102,7 +102,7 @@ public class index {
prop.put("searchoptions_count-10", (count == 10) ? "1" : "0");
prop.put("searchoptions_count-50", (count == 50) ? "1" : "0");
prop.put("searchoptions_count-100", (count == 100) ? "1" : "0");
prop.put("searchoptions_resource-select", sb.peers.sizeConnected() > 0 ? 1 : 0);
prop.put("searchoptions_resource-select", (sb.peers == null) ? 0 : sb.peers.sizeConnected() > 0 ? 1 : 0);
prop.put("searchoptions_resource-select_global", global ? "1" : "0");
prop.put("searchoptions_resource-select_global-disabled", (indexReceiveGranted && indexDistributeGranted) ? "0" : "1");
prop.put("searchoptions_resource-select_global-disabled_reason", (indexReceiveGranted) ? "0" : (indexDistributeGranted ? "1" : "2"));

@ -59,8 +59,7 @@ import net.yacy.kelondro.order.NaturalOrder;
import net.yacy.kelondro.table.Table;
import net.yacy.kelondro.util.FileUtils;
public class NewsQueue {
public class NewsQueue implements Iterable<NewsDB.Record> {
private final File path;
private Table queueStack;
@ -173,6 +172,11 @@ public class NewsQueue {
return b;
}
@Override
public Iterator<NewsDB.Record> iterator() {
return records(true);
}
public Iterator<NewsDB.Record> records(final boolean up) {
// iterates yacyNewsRecord-type objects
if (this.queueStack == null) return new HashSet<NewsDB.Record>().iterator();

Loading…
Cancel
Save