gnodet opened a new pull request, #12866:
URL: https://github.com/apache/maven/pull/12866

   ## Summary
   
   - Add null checks for `rootDirectory` in 
`DefaultModelBuilder.getEnhancedProperties()` to prevent `NullPointerException` 
when both `session.getRootDirectory()` throws `IllegalStateException` and 
`modelSource.getPath()` returns null
   - Guard `rootDirectory.toString()`/`toUri()` calls with a null check so root 
directory properties are simply omitted when unavailable (consistent with the 
existing `basedir` null check pattern)
   - Add `rootDirectory != null` guard before the `Objects.equals` check to 
prevent passing null to `modelProcessor.locateExistingPom()` — when 
rootDirectory is null, falls through to the else branch using the model's own 
properties
   - Add test `testBuildEffectiveWithNullRootDirectory` that exercises the 
exact code path via `BUILD_EFFECTIVE` with a resolved source (null path) and a 
session without a root directory
   
   Fixes #12590
   
   ## Test plan
   
   - [x] New test `testBuildEffectiveWithNullRootDirectory` verifies no NPE 
with null rootDirectory
   - [x] All 575 existing tests in `maven-impl` pass
   - [ ] CI green
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)


-- 
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]

Reply via email to