From: James Moger Date: Sat, 24 Mar 2012 19:02:40 +0000 (-0400) Subject: Fixed null pointer for LuceneExecutor unit tests X-Git-Tag: v0.9.0~18 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=462488624022a1cff16bebed6b3bb08b17ca80ab;p=gitblit.git Fixed null pointer for LuceneExecutor unit tests --- 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);