Skip to content

No NullReferenceException when passing null to Table.Set#179

Open
bplu4t2f wants to merge 2 commits into
moonsharp-devs:legacy/2.0from
bplu4t2f:dynvalue-null-fix
Open

No NullReferenceException when passing null to Table.Set#179
bplu4t2f wants to merge 2 commits into
moonsharp-devs:legacy/2.0from
bplu4t2f:dynvalue-null-fix

Conversation

@bplu4t2f

@bplu4t2f bplu4t2f commented Feb 3, 2017

Copy link
Copy Markdown
Contributor

Passing null as value parameter in any of the Table.Set overloads causes a NullReferenceException in Table.PerformTableSet. I propose either a proper ArgumentNullException, or giving null a reasonable meaning. Considering the similarity to setting the value to nil (instead of null) it might be reasonable to assume that the intent of the user in this case is to remove the value from the table.

@LimpingNinja LimpingNinja left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It's a little late, not certain if we should be checkin IsNil() here as well to be clear on the assumed intent. I may be wrong though, I probably should sleep. We do need an appropriate test case added to this PR as well if you can.

@Benjamin-Dobell
Benjamin-Dobell changed the base branch from master to legacy/2.0 March 3, 2026 07:00
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