- 
  Notifications
 You must be signed in to change notification settings 
- Fork 145
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
Conversation
There was a problem hiding this comment.
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.
Hi @jyoo980!
Great!!! It seems I've not been using well "optionals" 😅
Thanks for your contribution
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!
This is a patch that prevents a run-time exception when mounting an image fails when a
.dmgfile is generated.