-
-
Notifications
You must be signed in to change notification settings - Fork 368
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
Fix NPE when loadStructure fails #3812
Fix NPE when loadStructure fails #3812
Conversation
IMO it would be better to make sure every method that returns one or more Skript/src/main/java/ch/njol/skript/ScriptLoader.java Lines 823 to 825 in 885a4b6
but not all: Skript/src/main/java/ch/njol/skript/ScriptLoader.java Lines 797 to 803 in 885a4b6
|
Yes, that would be better. Looking now. |
I just added the null check to the method you've mentioned and the one that causes this error. Don't have time to look into all methods to find all ones that can return arrays/lists with null values though, so let me know if I've missed any. |
You should look at the usages of |
Closing as #3924 has been merged, fixing the same issues |
Description
Fixes NPE when loadStructure fails.
The NPE is not from loadScript returning null or not from info.commandNames actually, it is from cfg.getFileName. So this PR makes fileName default to "" (does not matter anyway since loadStructure failed, we do not want to sync commands or such)
Maybe just continue on empty script info or null cfg but that may change behaviour. I've tested this and it correctly sends permission denied errors.
Target Minecraft Versions: any
Requirements: none
Related Issues: #3804