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

CondIsEmpty Account for Null #5435

Open
1 task done
NotSoDelayed opened this issue Feb 10, 2023 · 1 comment
Open
1 task done

CondIsEmpty Account for Null #5435

NotSoDelayed opened this issue Feb 10, 2023 · 1 comment
Labels
documentation Related to Skript's official documentation. enhancement Feature request, an issue about something that could be improved, or a PR improving something. priority: lowest "Nice to have" updates that are not required (tiny low impact bug fixes or QoL enhancements).

Comments

@NotSoDelayed
Copy link
Contributor

NotSoDelayed commented Feb 10, 2023

Suggestion

As title stated, shall CondIsEmpty account for null?

Why?

As I faced a similar confusion when I was new to Skript, there seems to be no difference between (lets take a string for this case) a String with length of 0 and null, but programmatically speaking they do make a difference, where the condition will fail on the former and success on the latter, as screenshot below:
28F4ED49-B3A3-4A35-8A7A-25964C05AE15

Other

No response

Agreement

  • I have read the guidelines above and affirm I am following them with this suggestion.
@AyhamAl-Ali
Copy link
Member

AyhamAl-Ali commented Feb 10, 2023

With programming languages, this would usually throw an exception because the object is null so you can't get the length and since Skript doesn't like to throw such errors/exceptions at users, I think it would be better specify this case in the description rather than overriding the behavior and return true of it's not set, that causes another confusion.

If anyone have any other opinions feel free to share them with us.

@AyhamAl-Ali AyhamAl-Ali added documentation Related to Skript's official documentation. enhancement Feature request, an issue about something that could be improved, or a PR improving something. priority: lowest "Nice to have" updates that are not required (tiny low impact bug fixes or QoL enhancements). labels Feb 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Related to Skript's official documentation. enhancement Feature request, an issue about something that could be improved, or a PR improving something. priority: lowest "Nice to have" updates that are not required (tiny low impact bug fixes or QoL enhancements).
Projects
None yet
Development

No branches or pull requests

2 participants