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

NullPointerException from exposeAsEnvironment for container with custom name #85

Closed
tmccarthy opened this issue Jun 7, 2017 · 1 comment

Comments

@tmccarthy
Copy link
Contributor

If a container has a custom name specified with the container-name option, exposeAsEnvironment() throws an exception with the following stacktrace:

java.lang.NullPointerException: Cannot invoke method endsWith() on null object
        at java_lang_String$endsWith$1.call(Unknown Source)
        at com.avast.gradle.dockercompose.ComposeExtension$_exposeAsEnvironment_closure3$_closure9.doCall(ComposeExtension.groovy:68)
        at com.avast.gradle.dockercompose.ComposeExtension$_exposeAsEnvironment_closure3.doCall(ComposeExtension.groovy:67)
        at com.avast.gradle.dockercompose.ComposeExtension.exposeAsEnvironment(ComposeExtension.groovy:66)
        at com.avast.gradle.dockercompose.ComposeExtension$exposeAsEnvironment$3.call(Unknown Source)
        ...

The issue is that the regex at line 124 of ComposeUp will not necessarily match a custom container name. This leads to a null value of instanceName, which eventually causes the exception.

I will submit a pull request fixing this issue momentarily.

@augi
Copy link
Member

augi commented Jun 7, 2017

Released as 0.4.3, thanks again!

@augi augi closed this as completed Jun 7, 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