Skip to content

Conversation

@jyoo980
Copy link
Contributor

@jyoo980 jyoo980 commented Nov 23, 2023

This is a patch that prevents a run-time exception when mounting an image fails when a .dmg file is generated.

@jyoo980 jyoo980 changed the base branch from master to devel November 23, 2023 19:39
.filter(s -> s.contains(mountFolder.getAbsolutePath()))
.map(s -> StringUtils.normalizeSpace(s))
.map(s -> s.split(" ")[0])
.findFirst().get();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This call to get() will throw an exception in the case that mounting an image fails.

@fvarrui fvarrui merged commit 26e5417 into javapackager:devel Nov 30, 2023
@fvarrui
Copy link
Collaborator

fvarrui commented Nov 30, 2023

Hi @jyoo980!
Great!!! It seems I've not been using well "optionals" 😅
Thanks for your contribution

@jyoo980 jyoo980 deleted the yoo/patch-generate-dmg branch November 30, 2023 17:23
@jyoo980
Copy link
Contributor Author

jyoo980 commented Dec 18, 2023

Hi @fvarrui!

The Optional class is really annoying to use; and there are a lot of gotchas that can be difficult to catch. If you're interested in automated tools to help you catch bugs like these or more, I've been using the Checker Framework, which helps find bugs like these at compile-time!

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

Successfully merging this pull request may close these issues.

2 participants