From e48720a58cc1eaa52ed34f965e21ee9d44e8a654 Mon Sep 17 00:00:00 2001 From: reger Date: Sun, 15 Feb 2015 05:30:14 +0100 Subject: [PATCH] fix NPE in snippet computation --- source/net/yacy/search/snippet/TextSnippet.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/net/yacy/search/snippet/TextSnippet.java b/source/net/yacy/search/snippet/TextSnippet.java index 2a47a226f..9b516922b 100644 --- a/source/net/yacy/search/snippet/TextSnippet.java +++ b/source/net/yacy/search/snippet/TextSnippet.java @@ -166,7 +166,7 @@ public class TextSnippet implements Comparable, Comparator, Comparator snippetMaxLength) snippetLine = snippetLine.substring(0, snippetMaxLength); + if (textline.length() > snippetMaxLength) textline = textline.substring(0, snippetMaxLength); // finally store this snippet in our own cache snippetsCache.put(wordhashes, urls, textline); - init(url.hash(), snippetLine, false, source, null); + init(url.hash(), textline, false, source, null); } private void init(