Skip to content

DefaultDownloadManager: NPEs from uninitialized wagonManager and null getWagon() #84

Description

@elharo

Bugs #1 and #2 (related)

Both in DefaultDownloadManager.java:

1. NPE from no-arg constructor leaving wagonManager null

DefaultDownloadManager.java lines 55, 98, 134-135

The wagonManager field (line 55) is only set via the parameterized constructor (line 67-68). The no-arg constructor (line 62) leaves it null, but download() dereferences it unconditionally at lines 98, 134, and 135, causing a NullPointerException.

2. NPE when wagonManager.getWagon() returns null

DefaultDownloadManager.java lines 98, 121-122

wagonManager.getWagon() (line 98) may return null (the contract doesn't forbid it). The return value is never null-checked; lines 121-122 call wagon.addTransferListener() on it unconditionally, causing a NullPointerException.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions