Skip to content

Commit 72aac31

Browse files
committed
handle null returned from doCtags()
1 parent 66eaad7 commit 72aac31

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

opengrok-indexer/src/main/java/org/opengrok/indexer/analysis/Ctags.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
import java.util.logging.Logger;
4848

4949
import org.apache.commons.lang3.SystemUtils;
50+
import org.jetbrains.annotations.Nullable;
5051
import org.opengrok.indexer.configuration.RuntimeEnvironment;
5152
import org.opengrok.indexer.index.IndexerParallelizer;
5253
import org.opengrok.indexer.logger.LoggerFactory;
@@ -495,6 +496,7 @@ private void addTerraformSupport(List<String> command) {
495496
* @throws IOException I/O exception
496497
* @throws InterruptedException interrupted command
497498
*/
499+
@Nullable
498500
public Definitions doCtags(String file) throws IOException, InterruptedException {
499501

500502
if (file.length() < 1 || "\n".equals(file)) {

opengrok-indexer/src/main/java/org/opengrok/indexer/util/CtagsUtil.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ private static boolean canProcessFiles(String basePath) {
9393
Ctags ctags = new Ctags();
9494
try {
9595
Definitions definitions = ctags.doCtags(inputPath.toString());
96-
if (definitions.numberOfSymbols() > 1) {
96+
if (definitions != null && definitions.numberOfSymbols() > 1) {
9797
return true;
9898
}
9999
} catch (IOException | InterruptedException e) {

0 commit comments

Comments
 (0)