Skip to content

Commit a121e30

Browse files
authored
Merge pull request #79 from egineering-llc/bugfix/78
Null Pointer if there was no group.
2 parents 3ec1c8c + f931585 commit a121e30

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/com/e_gineering/maven/gitflowhelper/EnforceVersionsMojo.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ protected void execute(final GitBranchType type, final String gitBranch, final S
2929
}
3030

3131
// Non-master version branches require a pom version match of some kind to the branch subgroups.
32-
if (gitMatcher.groupCount() > 0) {
32+
if (gitMatcher.groupCount() > 0 && gitMatcher.group(gitMatcher.groupCount()) != null) {
3333
// HOTFIX and RELEASE branches require an exact match to the last subgroup.
3434
if ((GitBranchType.RELEASE.equals(type) || GitBranchType.HOTFIX.equals(type)) && !gitMatcher.group(gitMatcher.groupCount()).trim().equals(project.getVersion().trim())) {
3535
throw new MojoFailureException("The current git branch: [" + gitBranch + "] expected the maven project version to be: [" + gitMatcher.group(gitMatcher.groupCount()).trim() + "], but the maven project version is: [" + project.getVersion() + "]");

0 commit comments

Comments
 (0)