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

Dangerous unverified optional #1

Open
obr-09 opened this issue Feb 6, 2020 · 1 comment
Open

Dangerous unverified optional #1

obr-09 opened this issue Feb 6, 2020 · 1 comment
Labels
bug Something isn't working

Comments

@obr-09
Copy link
Member

obr-09 commented Feb 6, 2020

ItemStack item = ((Player) src).getItemInHand(HandTypes.MAIN_HAND).get();

Isn't this optional dangerous? In case there is nothing in hand it might throw an unexpected exception

@obr-09 obr-09 added the bug Something isn't working label Feb 6, 2020
@obr-09
Copy link
Member Author

obr-09 commented Feb 6, 2020

I'm surprised you didn't use any stream in the plugin (or maybe there are sponge MC version limitation?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant