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

Fix null reference in AddCommandHandlerCallable when callable does not return an object #80

Merged
merged 1 commit into from
Jan 24, 2025

Conversation

meybax
Copy link
Contributor

@meybax meybax commented Jan 24, 2025

When registering a command without a return value or that returns primitives, handling the command fails with a null reference exception when awaiting the asynchronous task. This fix only checks for an asynchronous callable if the return type is a GodotObject.

Copy link
Collaborator

@dogboydog dogboydog left a comment

Choose a reason for hiding this comment

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

This makes sense to me. Thanks for the fix. I will want to make sure to port this to development-v3 as well

@dogboydog dogboydog merged commit 30a8174 into YarnSpinnerTool:develop Jan 24, 2025
6 checks passed
@dogboydog
Copy link
Collaborator

dogboydog commented Jan 24, 2025

Actually I think it might already be handled in development-v3 , because all the references to GDScriptFunctionState are like this

     if (methodReturn.Obj != null && methodReturn.As<GodotObject>().GetClass() == "GDScriptFunctionState")
            {

Which checks for the null in a different way. But I'll try to remember to make sure to test again that this works in 0.3.0 when the methods return nothing

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