summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Moger <james.moger@gitblit.com>2012-03-24 15:02:40 -0400
committerJames Moger <james.moger@gitblit.com>2012-03-24 15:02:40 -0400
commit462488624022a1cff16bebed6b3bb08b17ca80ab (patch)
treed04ad2f1b8cad3614c9ba0809ceb37664e63d6f1
parent87db82f28371bac4a8bf4551ad964078301da8bd (diff)
downloadgitblit-462488624022a1cff16bebed6b3bb08b17ca80ab.tar.gz
gitblit-462488624022a1cff16bebed6b3bb08b17ca80ab.zip
Fixed null pointer for LuceneExecutor unit tests
-rw-r--r--src/com/gitblit/LuceneExecutor.java7
1 files changed, 6 insertions, 1 deletions
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<String>(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);