[
https://issues.apache.org/jira/browse/ARCHETYPE-585?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17075849#comment-17075849
]
Herve Boutemy commented on ARCHETYPE-585:
-----------------------------------------
question: how to reproduce this NPE? when does it happen?
> Missing null check causes NullPointerException
> ----------------------------------------------
>
> Key: ARCHETYPE-585
> URL: https://issues.apache.org/jira/browse/ARCHETYPE-585
> Project: Maven Archetype
> Issue Type: Bug
> Components: Archetypes
> Affects Versions: 3.1.2
> Reporter: Tony Homer
> Priority: Critical
> Time Spent: 10m
> Remaining Estimate: 0h
>
> RemoteCatalogArchetypeDataSource.getArchetypeCatalog calls
> [RemoteCatalogArchetypeDataSource.getMirror|https://github.com/apache/maven-archetype/blob/maven-archetype-3.1.2/archetype-common/src/main/java/org/apache/maven/archetype/source/RemoteCatalogArchetypeDataSource.java#L86].
> RemoteCatalogArchetypeDataSource.getMirror calls legacySupport.getSession,
> then [invokes getRequest on the returned
> value|https://github.com/apache/maven-archetype/blob/maven-archetype-3.1.2/archetype-common/src/main/java/org/apache/maven/archetype/source/RemoteCatalogArchetypeDataSource.java#L299]
> with no null check.
> When the legacySupport session is null, this results in a
> NullPointerException.
> The fix is to add a null check before calling session.getRequest.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)