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

Potential class casting issue during error handling for game opening #230

Open
haykam821 opened this issue Jun 9, 2022 · 0 comments
Open
Labels
bug Something isn't working

Comments

@haykam821
Copy link
Contributor

haykam821 commented Jun 9, 2022

When handling errors during game opening, Plasmid unwraps throwable in order to obtain an instance of GameOpenException. However, instead of casting the unwrapped exception which is guaranteed to be an instance of GameOpenException, Plasmid casts throwable, which isn't necessarily an instance of GameOpenException.

var gameOpenException = GameOpenException.unwrap(throwable);
MutableText message;
if (gameOpenException != null) {
message = ((GameOpenException) throwable).getReason().shallowCopy();
} else {

@haykam821 haykam821 added the bug Something isn't working label Jun 9, 2022
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