Skip to content

Add reflective check for ManifestEntryVerifier's different constructors #92

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
merged 1 commit into from
Jan 23, 2022

Conversation

diesieben07
Copy link

@diesieben07 diesieben07 commented Jan 19, 2022

Fixes #91

@sciwhiz12 sciwhiz12 added the bug label Jan 19, 2022
Constructor<ManifestEntryVerifier> mevConstructor = ManifestEntryVerifier.class.getConstructor(Manifest.class);
mevFactory = LamdbaExceptionUtils.rethrowFunction((manifest) -> mevConstructor.newInstance(manifest));
} catch (NoSuchMethodException e2) {
mevFactory = null;

Choose a reason for hiding this comment

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

This should probably throw else it will just throw an NPE later

Choose a reason for hiding this comment

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

This call chain is confusing; however, this sets jv = null which then sets JV = null, which then returns early in the only method that uses the factory based on JV being null.

Copy link
Member

@cpw cpw left a comment

Choose a reason for hiding this comment

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

Looks good

@cpw cpw merged commit e749b19 into McModLauncher:main-8.1.x Jan 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants