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

Compose: Fix NPE bug with docker-compose files in working directory #3866

Merged
merged 2 commits into from
Mar 13, 2021

Conversation

GooseMagnet
Copy link
Contributor

new File("file-in-working-directory.txt").getParentFile();

throws a NullPointerException

Solutions

  1. Prefix the path with ./new File("./file-in-working-directory.txt").getParentFile();
  2. call getAbsoluteFile() before getParentFile()

More details: https://bugs.openjdk.java.net/browse/JDK-8202972

Copy link
Member

@rnorth rnorth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks - this looks good to me.

@rnorth rnorth changed the title Fixed bug for docker-compose files in working directory Fix NPE bug with docker-compose files in working directory Mar 13, 2021
@rnorth rnorth merged commit b635eb5 into testcontainers:master Mar 13, 2021
@bsideup bsideup added this to the next milestone Apr 11, 2021
@rnorth rnorth changed the title Fix NPE bug with docker-compose files in working directory Compose: Fix NPE bug with docker-compose files in working directory Apr 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants