Skip to content

Commit fcd1459

Browse files
author
Vladimir Kotal
committed
check fa in newXrefWriter()
1 parent 2066188 commit fcd1459

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

opengrok-indexer/src/main/java/org/opengrok/indexer/index/IndexDatabase.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -725,7 +725,7 @@ private void addFile(File file, String path, Ctags ctags)
725725
fa.setFoldingEnabled(env.isFoldingEnabled());
726726

727727
Document doc = new Document();
728-
try (Writer xrefOut = newXrefWriter(path)) {
728+
try (Writer xrefOut = newXrefWriter(fa, path)) {
729729
analyzerGuru.populateDocument(doc, file, path, fa, xrefOut);
730730
} catch (InterruptedException e) {
731731
LOGGER.log(Level.WARNING, "File ''{0}'' interrupted--{1}",
@@ -1633,9 +1633,9 @@ public int hashCode() {
16331633
* Get a writer to which the xref can be written, or null if no xref
16341634
* should be produced for files of this type.
16351635
*/
1636-
private Writer newXrefWriter(String path) throws IOException {
1636+
private Writer newXrefWriter(AbstractAnalyzer fa, String path) throws IOException {
16371637
RuntimeEnvironment env = RuntimeEnvironment.getInstance();
1638-
if (env.isGenerateHtml()) {
1638+
if (env.isGenerateHtml() && fa != null) {
16391639
boolean compressed = env.isCompressXref();
16401640
File xrefFile = whatXrefFile(path, compressed);
16411641
File parentFile = xrefFile.getParentFile();

0 commit comments

Comments
 (0)