]> source.dussan.org Git - gitblit.git/commitdiff
Fixed null pointer for LuceneExecutor unit tests
authorJames Moger <james.moger@gitblit.com>
Sat, 24 Mar 2012 19:02:40 +0000 (15:02 -0400)
committerJames Moger <james.moger@gitblit.com>
Sat, 24 Mar 2012 19:02:40 +0000 (15:02 -0400)
src/com/gitblit/LuceneExecutor.java

index 5670d26bd6f7a30ecb6b74cfe8816e82175c49df..70d666f118656bd54ac2fb0ccf5e870159f4e2e8 100644 (file)
@@ -143,6 +143,11 @@ public class LuceneExecutor implements Runnable {
        public LuceneExecutor(IStoredSettings settings, File repositoriesFolder) {\r
                this.storedSettings = settings;\r
                this.repositoriesFolder = repositoriesFolder;\r
+               String exts = luceneIgnoreExtensions;\r
+               if (settings != null) {\r
+                       exts = settings.getString(Keys.web.luceneIgnoreExtensions, exts);\r
+               }\r
+               excludedExtensions = new TreeSet<String>(StringUtils.getStringsFromValue(exts));\r
        }\r
 \r
        /**\r
@@ -532,7 +537,7 @@ public class LuceneExecutor implements Runnable {
                                                // index the blob content\r
                                                if (StringUtils.isEmpty(ext) || !excludedExtensions.contains(ext)) {                                                    \r
                                                        ObjectLoader ldr = repository.open(blobId, Constants.OBJ_BLOB);\r
-                                                       InputStream in = ldr.openStream();                                                      \r
+                                                       InputStream in = ldr.openStream();                                              \r
                                                        int n;\r
                                                        while ((n = in.read(tmp)) > 0) {\r
                                                                os.write(tmp, 0, n);\r