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 NPE when reading or writing from a field that was empty before #33

Merged

Conversation

maxdanilov
Copy link
Contributor

@maxdanilov maxdanilov commented Feb 2, 2023

Fixing the regression introduced in #29.

In case a field is empty the whole field object returned from GH API upon reading is null and does not have a value key.


It's safe to pass undefined or null to setOutput since under the hood SDK does the conversion of these to an empty string: https://github.com/actions/toolkit/blob/main/packages/core/src/core.ts#L199, https://github.com/actions/toolkit/blob/main/packages/core/src/utils.ts#L12-L13

Copy link
Collaborator

@benbalter benbalter left a comment

Choose a reason for hiding this comment

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

Thanks @maxdanilov! 🚀

@benbalter benbalter enabled auto-merge February 2, 2023 16:18
@benbalter benbalter merged commit 6eeb9c0 into github:main Feb 2, 2023
@maxdanilov maxdanilov deleted the fix-updates-reads-to-empty-values branch February 6, 2023 16:23
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