elharo opened a new pull request, #72:
URL: https://github.com/apache/maven-mapping/pull/72
## Problem
`MappingUtils.evaluateFileNameMapping(String, Artifact)` throws an opaque
`NullPointerException` when `artifact` is null, making it difficult for callers
to diagnose the issue:
```
NullPointerException: Cannot invoke "Artifact.getArtifactHandler()" because
"artifact" is null
```
## Fix
Added an explicit null check at the start of `evaluateFileNameMapping` that
throws `IllegalArgumentException` with a clear message:
```java
if (artifact == null) {
throw new IllegalArgumentException("artifact cannot be null");
}
```
## Test
Added `mappingWithNullArtifact` which verifies that
`IllegalArgumentException` is thrown when null is passed for the artifact
parameter.
All 7 tests pass.
Closes #62
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]