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

Add safety net when running sections with null inputs #99

Closed
sovdeeth opened this issue Feb 27, 2024 · 1 comment
Closed

Add safety net when running sections with null inputs #99

sovdeeth opened this issue Feb 27, 2024 · 1 comment
Labels
bug Something isn't working priority: low

Comments

@sovdeeth
Copy link
Member

sovdeeth commented Feb 27, 2024

Is your feature request related to a problem? Please describe.
When running a section, say, with 2 inputs and you provide a null input as the first one, an AIIOB will be thrown when it tries to set the (second?) variable.

Describe the solution you'd like
No exception should be thrown, the variable should stay unset.

Describe alternatives you've considered
This should be a simple check in Section#run()

Additional context
Provided stacktrace from user:

[19:42:44 WARN]: [skript-reflect] Plugin skript-reflect v2.4 generated an exception while executing task 32
java.lang.ArrayIndexOutOfBoundsException: Index 0 out of bounds for length 0
        at ch.njol.skript.lang.Variable.change(Variable.java:550) ~[Skript.jar:?]
        at com.btk5h.skriptmirror.skript.reflect.sections.Section.run(Section.java:35) ~[skript-reflect.jar:?]
        at com.btk5h.skriptmirror.skript.reflect.sections.EffRunSection.lambda$walk$2(EffRunSection.java:95) ~[skript-reflect.jar:?]
        at org.bukkit.craftbukkit.v1_20_R3.scheduler.CraftTask.run(CraftTask.java:101) ~[purpur-1.20.4.jar:git-Purpur-2118]
        at org.bukkit.craftbukkit.v1_20_R3.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:57) ~[purpur-1.20.4.jar:git-Purpur-2118]
        at com.destroystokyo.paper.ServerSchedulerReportingWrapper.run(ServerSchedulerReportingWrapper.java:22) ~[purpur-1.20.4.jar:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?]
        at java.lang.Thread.run(Thread.java:840) ~[?:?]

when running

run section {ask_command_handler} async with player's uuid, arg-1

in a command as console, leading player's uuid to be unset.

@sovdeeth sovdeeth added bug Something isn't working priority: low labels Feb 27, 2024
@Vulcano771
Copy link
Contributor

Vulcano771 commented Apr 11, 2024

Should be fixed by my pr #102

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

No branches or pull requests

2 participants