add null check on parsing svn properties in browsecommand

This commit is contained in:
Eduard Heimbuch
2020-10-14 10:47:03 +02:00
parent 12e01825e8
commit d273b19f68
2 changed files with 20 additions and 14 deletions

View File

@@ -193,23 +193,28 @@ public class SvnBrowseCommand extends AbstractSvnCommand
repository.getDir(entry.getRelativePath(), revision, properties, (Collection) null);
String[] externals = properties.getStringValue(SVNProperty.EXTERNALS).split("\\r?\\n");
for (String external : externals) {
String subRepoUrl = "";
String subRepoPath = "";
for (String externalPart : external.split(" ")) {
if (shouldSetExternal(externalPart)) {
subRepoUrl = externalPart;
} else if (!externalPart.contains("-r")) {
subRepoPath = externalPart;
String externals = properties.getStringValue(SVNProperty.EXTERNALS);
if (!Strings.isNullOrEmpty(externals)) {
String[] splitExternals = externals.split("\\r?\\n");
for (String external : splitExternals) {
String subRepoUrl = "";
String subRepoPath = "";
for (String externalPart : external.split(" ")) {
if (shouldSetExternal(externalPart)) {
subRepoUrl = externalPart;
} else if (!externalPart.contains("-r")) {
subRepoPath = externalPart;
}
}
if (Util.isNotEmpty(external)) {
SubRepository subRepository = new SubRepository(subRepoUrl);
fileObject.addChild(createSubRepoDirectory(subRepository, subRepoPath));
}
}
if (Util.isNotEmpty(external)) {
SubRepository subRepository = new SubRepository(subRepoUrl);
fileObject.addChild(createSubRepoDirectory(subRepository, subRepoPath));
}
}
} catch (SVNException ex) {
logger.error("could not fetch file properties", ex);
}