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

NPE when reading version.properties #42

Closed
marsangr opened this issue Nov 3, 2017 · 2 comments
Closed

NPE when reading version.properties #42

marsangr opened this issue Nov 3, 2017 · 2 comments

Comments

@marsangr
Copy link

marsangr commented Nov 3, 2017

The following code in HttpConnector from the draft branch

    try (InputStream in = HttpConnector.class.getResourceAsStream("/org/shredzone/acme4j/version.properties")) {
        Properties prop = new Properties();
        prop.load(in);
        agent.append('/').append(prop.getProperty("version"));
    } catch (IOException ex) {
        // Ignore, just don't use a version
        LoggerFactory.getLogger(HttpConnector.class).warn("Could not read library version", ex);
    }

throws a NullPointerException in the load() method when running against a freshly checked out version.properties.

Since reading the version seems not to be critical, I'd rather change the catch(IOException) to a more generic catch(Exception).

@shred
Copy link
Owner

shred commented Nov 4, 2017

I agree. I'm going to fix that.

shred added a commit that referenced this issue Nov 4, 2017
shred added a commit that referenced this issue Nov 4, 2017
@shred
Copy link
Owner

shred commented Nov 4, 2017

Fixed in master and draft branch. The release jars are not affected by this issue, so I'm closing it. Thank you!

@shred shred closed this as completed Nov 4, 2017
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

2 participants