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

[Lua]Return nil instead of bogus userdata when functions fail #520

Merged
merged 1 commit into from
Dec 15, 2024

Conversation

TheGondos
Copy link
Contributor

@TheGondos TheGondos commented Dec 7, 2024

Some functions may fail (e.g. adding particle streams when particles are disabled) and return a userdata containing a NULL pointer.
Since the userdata is opaque, there is no way to know that the function failed from a calling script.
This PR prevents returning such userdata and returns nil instead so that scripts can handle the failure gracefully.

@jarmonik jarmonik merged commit 2205bfe into orbitersim:main Dec 15, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants