Tony Homer created ARCHETYPE-585:
------------------------------------

             Summary: 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


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)

Reply via email to