Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Prevent run-time exception when image mounting fails #379

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

Merged
fvarrui merged 1 commit into javapackager:devel from jyoo980:yoo/patch-generate-dmg
Nov 30, 2023

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
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
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!

fvarrui reacted with thumbs up emoji

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

AltStyle によって変換されたページ (->オリジナル) /