Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mappings without sources throw NullPointerException #125

Open
JasonWThompson opened this issue Nov 30, 2020 · 0 comments
Open

Mappings without sources throw NullPointerException #125

JasonWThompson opened this issue Nov 30, 2020 · 0 comments

Comments

@JasonWThompson
Copy link

JasonWThompson commented Nov 30, 2020

This issue occurs in the master branch.

When building an RPM that includes a mapping without sources, an NullPointerException is thrown. This is due to an issue in SpecWriter.java on line 242. Specifically this line of code:

final boolean noFiles = map.getSources().isEmpty() || (scanner.isEverythingIncluded() && links.isEmpty());

map.getSources() will return null when sources are not defined and thus throws the NPE when calling isEmpty().

A couple of ways to fix this would be to either return an empty list from getSources() when Mapping.source is null or to check for null in the line above in addition to checking if sources is empty.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant