From 462488624022a1cff16bebed6b3bb08b17ca80ab Mon Sep 17 00:00:00 2001 From: James Moger Date: Sat, 24 Mar 2012 15:02:40 -0400 Subject: [PATCH] Fixed null pointer for LuceneExecutor unit tests --- src/com/gitblit/LuceneExecutor.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/com/gitblit/LuceneExecutor.java b/src/com/gitblit/LuceneExecutor.java index 5670d26b..70d666f1 100644 --- a/src/com/gitblit/LuceneExecutor.java +++ b/src/com/gitblit/LuceneExecutor.java @@ -143,6 +143,11 @@ public class LuceneExecutor implements Runnable { public LuceneExecutor(IStoredSettings settings, File repositoriesFolder) { this.storedSettings = settings; this.repositoriesFolder = repositoriesFolder; + String exts = luceneIgnoreExtensions; + if (settings != null) { + exts = settings.getString(Keys.web.luceneIgnoreExtensions, exts); + } + excludedExtensions = new TreeSet(StringUtils.getStringsFromValue(exts)); } /** @@ -532,7 +537,7 @@ public class LuceneExecutor implements Runnable { // index the blob content if (StringUtils.isEmpty(ext) || !excludedExtensions.contains(ext)) { ObjectLoader ldr = repository.open(blobId, Constants.OBJ_BLOB); - InputStream in = ldr.openStream(); + InputStream in = ldr.openStream(); int n; while ((n = in.read(tmp)) > 0) { os.write(tmp, 0, n); -- 2.39.5