Skip to content

Fix nullable enum properties crashing on insertion - #111

Open
Eisfunke wants to merge 4 commits into
PhenX:mainfrom
Eisfunke:nullable-enum
Open

Fix nullable enum properties crashing on insertion#111
Eisfunke wants to merge 4 commits into
PhenX:mainfrom
Eisfunke:nullable-enum

Conversation

@Eisfunke

Copy link
Copy Markdown
Contributor

See #110 for details

This makes it possible to use multiple containers with different settings using the same base DBMS
Eisfunke and others added 3 commits June 29, 2026 15:54
… type

Previously, null-checks were only performed for nullable *reference* types.
Nullable types that have a converter to a value type, like enums, lost their nullability during conversion, leading to runtime-crashes.
@Eisfunke

Copy link
Copy Markdown
Contributor Author

Hey! My colleague @davidmehren and I were able to fix this problem.

It looks like previously, null-checks were only performed for nullable reference types. Nullable types that have a converter to a value type, like enums, lost their nullability during conversion, leading to runtime-crashes.

Our guess is that this wasn't noticed before since nullable value types that have a conversion are pretty much only nullable enums in everyday usage, because the more common types like int? don't need conversions.

So this MR now adds a test and a fix for this and should be mergeable now. (note that I added a few files to the .gitignore for my own setup, if you don't want those flying around there, just say so and I'll take that out)

@Eisfunke Eisfunke changed the title WIP: test for nullable enum properties crashing on insertion Fix nullable enum properties crashing on insertion Jun 29, 2026
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