Skip to content

Fix: Resolved NullPointerException in VersionHelper.getCurrentVersion()#56

Closed
Takaranoao wants to merge 1 commit into
PlaceholderAPI:masterfrom
Takaranoao:master
Closed

Fix: Resolved NullPointerException in VersionHelper.getCurrentVersion()#56
Takaranoao wants to merge 1 commit into
PlaceholderAPI:masterfrom
Takaranoao:master

Conversation

@Takaranoao
Copy link
Copy Markdown

Fixed :

Caused by: java.lang.NullPointerException: Cannot invoke "java.lang.CharSequence.length()" because "this.text" is null
        at java.util.regex.Matcher.getTextLength(Matcher.java:1808) ~[?:?]
        at java.util.regex.Matcher.reset(Matcher.java:461) ~[?:?]
        at java.util.regex.Matcher.<init>(Matcher.java:256) ~[?:?]
        at java.util.regex.Pattern.matcher(Pattern.java:1180) ~[?:?]
        at at.helpch.placeholderapi.expansion.server.util.VersionHelper.getCurrentVersion(VersionHelper.java:75) ~[?:?]
        at at.helpch.placeholderapi.expansion.server.util.VersionHelper.<clinit>(VersionHelper.java:42) ~[?:?]
        ... 62 more

@Kqliber
Copy link
Copy Markdown

Kqliber commented May 10, 2024

The NPE is coming from the fact that getCurrentVersion() is being called while MINECRAFT_VERSION has not yet been initialized (hence the NPE)

all that needs to be changed is that this field gets initialized before the method is called

@iGabyTM
Copy link
Copy Markdown
Member

iGabyTM commented May 14, 2024

Thank you for the contribution but this was fixed on e728eb5

@iGabyTM iGabyTM closed this May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants