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 uncaught error from yield without arguments #8

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

chrissantamaria
Copy link

👋 big fan of this project! makes the migration to typed-redux-saga much simpler :)

I did notice a minor bug - looks like yield expressions without arguments (i.e. just yield;) cause a crash due to the following section:

YieldExpression(node) {
tracker.enterYieldExpression(node);
if (!node.delegate && isSagaCall(node.argument)) {

With no arguments, node.argument is null which isSagaCall isn't able to handle.

I've added a tiny check to just return false for that case since it's clearly not a saga call, though the defensive logic could be moved to consumers of isSagaCall as well.

@chrissantamaria
Copy link
Author

cc @SantoJambit @Lusito, any chance this could get merged + released? happy to make any necessary changes, thanks!

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.

1 participant