1
0
mirror of https://github.com/yacy/yacy_search_server.git synced 2025-07-21 09:04:37 -04:00

fix for NPE in IndexCreateParserErrors_p.html caused by bad handling of

lazy value instantiation of 0-value in crawldepth_i
This commit is contained in:
orbiter
2014-04-22 19:48:49 +02:00
parent 12ba890205
commit 4ee4ba1576
2 changed files with 3 additions and 2 deletions
htroot
source/net/yacy/search/schema

@ -573,7 +573,7 @@ public class HostBrowser {
Integer rc_internal = (Integer) doc.getFieldValue(CollectionSchema.references_internal_i.getSolrFieldName());
Integer rc_external = (Integer) doc.getFieldValue(CollectionSchema.references_external_i.getSolrFieldName());
Integer rc_exthosts = (Integer) doc.getFieldValue(CollectionSchema.references_exthosts_i.getSolrFieldName());
this.crawldepth = (cr == null || cr.intValue() < 0) ? 998 : cr.intValue();
this.crawldepth = (cr == null || cr.intValue() < 0) ? 0 : cr.intValue(); // for lazy value storage; non-existent means: stored as '0'
this.references = (rc == null || rc.intValue() <= 0) ? 0 : rc.intValue();
this.references_internal = (rc_internal == null || rc_internal.intValue() <= 0) ? 0 : rc_internal.intValue();
// calculate the url reference list

@ -1502,7 +1502,8 @@ public class CollectionConfiguration extends SchemaConfiguration implements Seri
this.failType = fts == null ? FailType.fail : FailType.valueOf(fts);
this.httpstatus = (Integer) doc.getFieldValue(CollectionSchema.httpstatus_i.getSolrFieldName());
this.failtime = (Date) doc.getFieldValue(CollectionSchema.load_date_dt.getSolrFieldName());
this.crawldepth = (Integer) doc.getFieldValue(CollectionSchema.crawldepth_i.getSolrFieldName());
Integer cd = (Integer) doc.getFieldValue(CollectionSchema.crawldepth_i.getSolrFieldName());
this.crawldepth = cd == null ? 0 : cd.intValue();
}
public DigestURL getDigestURL() {
return digestURL;