Skip to content

Commit 4c638aa

Browse files
author
TheSnoozer
committed
guard against context proprtites being null to make the tests pass again
1 parent c7089e3 commit 4c638aa

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/main/java/pl/project13/maven/git/GitCommitIdMojo.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -1411,17 +1411,17 @@ public boolean shouldPropertiesEscapeUnicode() {
14111411
}
14121412

14131413
private void publishToAllSystemEnvironments(
1414-
LogInterface log,
1415-
Properties propertiesToPublish,
1416-
Properties contextProperties) {
1414+
@Nonnull LogInterface log,
1415+
@Nonnull Properties propertiesToPublish,
1416+
@Nullable Properties contextProperties) {
14171417
publishPropertiesInto(propertiesToPublish, project.getProperties());
14181418
// some plugins rely on the user properties (e.g. flatten-maven-plugin)
14191419
publishPropertiesInto(propertiesToPublish, session.getUserProperties());
14201420

14211421
if (injectAllReactorProjects) {
14221422
Properties diffPropertiesToPublish = new Properties();
14231423
propertiesToPublish.forEach((k, v) -> {
1424-
if (!contextProperties.contains(k)) {
1424+
if (contextProperties == null || !contextProperties.contains(k)) {
14251425
diffPropertiesToPublish.setProperty(k.toString(), v.toString());
14261426
}
14271427
});

0 commit comments

Comments
 (0)