-
-
Notifications
You must be signed in to change notification settings - Fork 379
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
Default value being null on EntryData causes the default value to always throw #7468
Comments
You can't use null as a default value. It doesn't really make sense. What you want to use is getOptional. |
The defaultValue is stated nullable, and there is no constructor parameters to not provide a default value. I don't want one, that's why I put null. I want it to return null if there is no value present.
|
I would like to see changes made to However using The entry itself is required, I see no reason on a dev end to use A user as I mentioned before can still pass anything they want into that field (which isn't Object.class it's Block.class) and it'll be parsed as if it's fine, developers shouldn't be forced to use The broadcast for |
If you want null, use getOptional. It wouldn't be possible to get the same error from it, and if you are, can you send a stack trace? |
Skript/Server Version
Bug Description
When registering the default value as null
and defining true to return the default.
Skript will error
Expected Behavior
Skript should not error if the default value is null itself. Skript should simply return null as it's the expected return.
Using an object or Optionals can fix this from happening.
Using
Causes the same error to occur.
Agreement
The text was updated successfully, but these errors were encountered: