fix: Handle null form field values instead of throwing#1041
Open
felipe-sme wants to merge 1 commit intosupertokens:masterfrom
Open
fix: Handle null form field values instead of throwing#1041felipe-sme wants to merge 1 commit intosupertokens:masterfrom
felipe-sme wants to merge 1 commit intosupertokens:masterfrom
Conversation
✅ Deploy Preview for precious-marshmallow-968a81 canceled.
|
✅ Deploy Preview for astounding-pegasus-21c111 canceled.
|
felipe-sme
commented
Feb 23, 2026
| ((typeof input.value === "string" | ||
| ? input.value.length > 0 | ||
| : input.value !== null && typeof input.value !== "undefined") || | ||
| (typeof input.value === "object" && Object.values(input.value).length > 0)); |
Author
There was a problem hiding this comment.
The (typeof input.value === "object" && Object.values(input.value).length > 0) branch looks like dead code. An empty object as a form field value evaluates as true by input.value !== null && typeof input.value !== "undefined") short-circuiting the check before it reaches line 117.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of change
Closes #1026 by handling form fields with value null as invalid rather than throwing.
Related issues
#1026
Test Plan
(Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your changes work. Bonus points for screenshots and videos!)
Documentation changes
(If relevant, please create a PR in our docs repo, or create a checklist here highlighting the necessary changes)
Checklist for important updates
coreDriverInterfaceSupported.jsonfile has been updated (if needed)lib/ts/version.tsfrontendDriverInterfaceSupported.jsonfile has been updated (if needed)package.jsonpackage-lock.jsonlib/ts/version.tsnpm run build-prettyrecipe/thirdparty/providers/configUtils.tsfile,createProviderfunction.git tag) in the formatvX.Y.Z, and then find the latest branch (git branch --all) whoseX.Yis greater than the latest released tag.add-ts-no-check.jsfile to include thatsomeFunc: function () {..}).exportsinpackage.jsonRemaining TODOs for this PR