Permalink
Browse files

fix NPE in HTMLResponseWriter on missing document title

  • Loading branch information...
reger24 committed Feb 16, 2017
1 parent 5e8879b commit 7e53860fc790746db2caa0886a9bd1091fbda9e1
Showing with 2 additions and 1 deletion.
  1. +2 −1 source/net/yacy/cora/federate/solr/responsewriter/HTMLResponseWriter.java
@@ -165,7 +165,8 @@ public void write(final Writer writer, final SolrQueryRequest request, final Sol
Document doc = searcher.doc(id, DEFAULT_FIELD_LIST);
LinkedHashMap<String, String> tdoc = translateDoc(schema, doc);
String title = doc.get(CollectionSchema.title.getSolrFieldName()); // title is multivalued, after translation fieldname could be in tdoc. "title_0" ..., so get it from doc
String title = doc.get(CollectionSchema.title.getSolrFieldName()); // title is multivalued, after translation fieldname could be in tdoc. "title_0" ..., so get it from doc
if (title == null) title = "";
if (sz == 1) {
writer.write("<title>" + title + "</title>\n</head><body>\n");
} else {

0 comments on commit 7e53860

Please sign in to comment.