Skip to content

Fix nullable direction combine #8121

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

Open
wants to merge 2 commits into
base: dev/patch
Choose a base branch
from

Conversation

TheLimeGlass
Copy link
Contributor

Problem

If your syntax has nullable expressions [%-direction% %-location%] and used directly expression = Direction.combine((Expression<Direction>) exprs[0], (Expression<Location>) exprs[1]); it'll throw a null pointer on use.

Solution

Rather than having to check if both expressions are null before calling the combine method, you can now properly do the single line call, and the returned expression will be the expected null if the syntax was wanting the expression to be null if not present.


Completes: none
Related: none

@TheLimeGlass TheLimeGlass requested a review from a team as a code owner August 10, 2025 17:59
@TheLimeGlass TheLimeGlass requested review from Pesekjak and Absolutionism and removed request for a team August 10, 2025 17:59
@skriptlang-automation skriptlang-automation bot added the needs reviews A PR that needs additional reviews label Aug 10, 2025
@skriptlang-automation skriptlang-automation bot removed the needs reviews A PR that needs additional reviews label Aug 10, 2025
@Efnilite Efnilite added the enhancement Feature request, an issue about something that could be improved, or a PR improving something. label Aug 10, 2025
Copy link
Contributor

@Pesekjak Pesekjak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good. I would add @Nullable for the params

@TheLimeGlass TheLimeGlass requested a review from Efnilite August 11, 2025 14:01
@skriptlang-automation skriptlang-automation bot added the patch-ready A PR/issue that has been approved and is ready to be merged/closed for the next patch version. label Aug 11, 2025
@APickledWalrus APickledWalrus moved this to Awaiting Merge in 2.12 Releases Aug 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature request, an issue about something that could be improved, or a PR improving something. patch-ready A PR/issue that has been approved and is ready to be merged/closed for the next patch version.
Projects
Status: Awaiting Merge
Development

Successfully merging this pull request may close these issues.

5 participants