Skip to content

Commit c8a8f1d

Browse files
author
Vladimir Kotal
committed
avoid NPE
1 parent 3a3fef6 commit c8a8f1d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

opengrok-indexer/src/main/java/org/opengrok/indexer/history/GitRepository.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -793,9 +793,14 @@ private RevCommit getCommit(org.eclipse.jgit.lib.Repository repository, Ref ref)
793793
}
794794

795795
@Override
796+
@Nullable
796797
String determineParent(CommandTimeoutType cmdType) throws IOException {
797798
try (org.eclipse.jgit.lib.Repository repository = getJGitRepository(getDirectoryName())) {
798-
return repository.getConfig().getString("remote", "origin", "url");
799+
if (repository.getConfig() != null) {
800+
return repository.getConfig().getString("remote", "origin", "url");
801+
} else {
802+
return null;
803+
}
799804
}
800805
}
801806

0 commit comments

Comments
 (0)