From 9c33b2fb58ea1cde12d6c5ea9e94fcb0e217b7a0 Mon Sep 17 00:00:00 2001 From: orbiter Date: Thu, 5 May 2011 23:11:03 +0000 Subject: [PATCH] fix for String Matcher in case that no snippet is returned (NPE) git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@7702 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- source/de/anomic/search/ResultFetcher.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/de/anomic/search/ResultFetcher.java b/source/de/anomic/search/ResultFetcher.java index 9ed2ef1fa..24f293cef 100644 --- a/source/de/anomic/search/ResultFetcher.java +++ b/source/de/anomic/search/ResultFetcher.java @@ -344,9 +344,9 @@ public class ResultFetcher { loops++; final ResultEntry resultEntry = fetchSnippet(page, cacheStrategy); // does not fetch snippets if snippetMode == 0 if (resultEntry == null) continue; // the entry had some problems, cannot be used - String rawLine = resultEntry.textSnippet().getLineRaw(); + String rawLine = resultEntry.textSnippet() == null ? null : resultEntry.textSnippet().getLineRaw(); //System.out.println("***SNIPPET*** raw='" + rawLine + "', pattern='" + this.snippetPattern.toString() + "'"); - if (!this.snippetPattern.matcher(rawLine).matches()) continue; + if (rawLine != null && !this.snippetPattern.matcher(rawLine).matches()) continue; //if (result.contains(resultEntry)) continue; urlRetrievalAllTime += resultEntry.dbRetrievalTime;