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

Having more than one custom syntax with the same pattern causes an exception #86

Open
Pikachu920 opened this issue Jan 17, 2024 · 0 comments
Labels
bug Something isn't working priority: medium

Comments

@Pikachu920
Copy link
Member

Describe the bug
Having more than one custom syntax with the same pattern causes an exception upon reloading. This exception only occurs during unload, so you will need to reload the test script to reproduce. The duplicate custom syntax can be in the same script or in other scripts.

[19:17:45 ERROR]: #!#!
[19:17:45 ERROR]: #!#! [Skript] Severe Error:
[19:17:45 ERROR]: #!#! Exception occurred in Skript's main command
[19:17:45 ERROR]: #!#! Used command: /sk reload test
[19:17:45 ERROR]: #!#!
[19:17:45 ERROR]: #!#! Something went horribly wrong with Skript.
[19:17:45 ERROR]: #!#! This issue is NOT your fault! You probably can't fix it yourself, either.
[19:17:45 ERROR]: #!#! It looks like you are using some plugin(s) that alter how Skript works (addons).
[19:17:45 ERROR]: #!#! Here is full list of them:
[19:17:45 ERROR]: #!#! skript-reflect v2.4 (https://github.com/SkriptLang/skript-reflect)
[19:17:45 ERROR]: #!#! We could not identify which of those are specially related, so this might also be Skript issue.
[19:17:45 ERROR]: #!#! You should try disabling those plugins one by one, trying to find which one causes it.
[19:17:45 ERROR]: #!#! If the error doesn't disappear even after disabling all listed plugins, it is probably Skript issue.
[19:17:45 ERROR]: #!#! In that case, you will be given instruction on how should you report it.
[19:17:45 ERROR]: #!#! On the other hand, if the error disappears when disabling some plugin, report it to author of that plugin.
[19:17:45 ERROR]: #!#! Only if the author tells you to do so, report it to Skript's issue tracker.
[19:17:45 ERROR]: #!#!
[19:17:45 ERROR]: #!#! Stack trace:
[19:17:45 ERROR]: #!#! java.lang.NullPointerException: Cannot invoke "java.util.Map.remove(Object)" because "syntaxes" is null
[19:17:45 ERROR]: #!#!     at skript-reflect (5).jar//org.skriptlang.reflect.syntax.CustomSyntaxStructure.lambda$unload$1(CustomSyntaxStructure.java:158)
[19:17:45 ERROR]: #!#!     at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
[19:17:45 ERROR]: #!#!     at skript-reflect (5).jar//org.skriptlang.reflect.syntax.CustomSyntaxStructure.unload(CustomSyntaxStructure.java:153)
[19:17:45 ERROR]: #!#!     at Skript (12).jar//ch.njol.skript.ScriptLoader.unloadScripts(ScriptLoader.java:830)
[19:17:45 ERROR]: #!#!     at Skript (12).jar//ch.njol.skript.ScriptLoader.unloadScript(ScriptLoader.java:864)
[19:17:45 ERROR]: #!#!     at Skript (12).jar//ch.njol.skript.SkriptCommand.onCommand(SkriptCommand.java:189)
[19:17:45 ERROR]: #!#!     at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45)
[19:17:45 ERROR]: #!#!     at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:155)
[19:17:45 ERROR]: #!#!     at org.bukkit.craftbukkit.v1_20_R2.CraftServer.dispatchCommand(CraftServer.java:991)
[19:17:45 ERROR]: #!#!     at org.bukkit.craftbukkit.v1_20_R2.CraftServer.dispatchServerCommand(CraftServer.java:976)
[19:17:45 ERROR]: #!#!     at net.minecraft.server.dedicated.DedicatedServer.bf(DedicatedServer.java:500)
[19:17:45 ERROR]: #!#!     at net.minecraft.server.dedicated.DedicatedServer.b(DedicatedServer.java:447)
[19:17:45 ERROR]: #!#!     at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:1379)
[19:17:45 ERROR]: #!#!     at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:1156)
[19:17:45 ERROR]: #!#!     at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:315)
[19:17:45 ERROR]: #!#!     at java.base/java.lang.Thread.run(Thread.java:833)
[19:17:45 ERROR]: #!#!
[19:17:45 ERROR]: #!#! Version Information:
[19:17:45 ERROR]: #!#!   Skript: 2.8.0 (latest)
[19:17:45 ERROR]: #!#!     Flavor: skriptlang-github
[19:17:45 ERROR]: #!#!     Date: 18:20:11.223179900
[19:17:45 ERROR]: #!#!   Bukkit: 1.20.2-R0.1-SNAPSHOT
[19:17:45 ERROR]: #!#!   Minecraft: 1.20.2
[19:17:45 ERROR]: #!#!   Java: 17.0.2 (Java HotSpot(TM) 64-Bit Server VM 17.0.2+8-LTS-86)
[19:17:45 ERROR]: #!#!   OS: Windows 10 amd64 10.0
[19:17:45 ERROR]: #!#!
[19:17:45 ERROR]: #!#! Server platform: Paper
[19:17:45 ERROR]: #!#!
[19:17:45 ERROR]: #!#! Current node: null
[19:17:45 ERROR]: #!#! Current item: null
[19:17:45 ERROR]: #!#!
[19:17:45 ERROR]: #!#! Thread: Server thread
[19:17:45 ERROR]: #!#!
[19:17:45 ERROR]: #!#! Language: english
[19:17:45 ERROR]: #!#! Link parse mode: DISABLED
[19:17:45 ERROR]: #!#!
[19:17:45 ERROR]: #!#! End of Error.
[19:17:45 ERROR]: #!#!

To reproduce

  1. Add this script to your server
effect test:
  trigger:
    stop
	
effect test:
  trigger:
    stop
  1. Start server (note script loads fine)
  2. Reload the script
  3. Exception!

Expected behavior
A parse time error

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: medium
Projects
None yet
Development

No branches or pull requests

2 participants