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

This PR fixes java.lang.ArrayIndexOutOfBoundsException: Index 0 out of bounds for length 0 #102

Merged
merged 4 commits into from
May 8, 2024

Conversation

Vulcano771
Copy link
Contributor

@Vulcano771 Vulcano771 commented Apr 9, 2024

[13:21:00 WARN]: org.apache.commons.lang.UnhandledException: Plugin skript-reflect v2.3 generated an exception while executing task 6
        at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:56)
        at org.github.paperspigot.ServerSchedulerReportingWrapper.run(ServerSchedulerReportingWrapper.java:23)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
        at java.base/java.lang.Thread.run(Thread.java:1623)
Caused by: java.lang.ArrayIndexOutOfBoundsException: Index 0 out of bounds for length 0
        at ch.njol.skript.lang.Variable.change(Variable.java:517)
        at com.btk5h.skriptmirror.skript.reflect.sections.Section.run(Section.java:36)
        at com.btk5h.skriptmirror.skript.reflect.sections.EffRunSection.lambda$walk$2(EffRunSection.java:92)
        at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftTask.run(CraftTask.java:59)
        at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:53)
        ... 4 more
on load:
    create new section with {_request} stored in {test}:
        if {_request} is not set:
            return false
        
        return true
    run section {test} async with {_n} and store result in {_result} and wait
    broadcast "Result: %{_result}%"

Tested in old and latest version (1.20.4) - in both the error exists.
This pr fixes that

Copy link
Member

@sovdeeth sovdeeth 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

Copy link
Member

@UnderscoreTud UnderscoreTud 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 as a band-aid fix, but I think this should be handled directly in Skript's variable changer

@sovdeeth sovdeeth merged commit b802342 into SkriptLang:2.x May 8, 2024
2 checks passed
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.

5 participants