Skip to content

Commit

Permalink
fix. null reference exception
Browse files Browse the repository at this point in the history
  • Loading branch information
alec1o committed May 25, 2024
1 parent d740cf0 commit 4e620ea
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/src/primitive/partials/PrimitiveGet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -467,9 +467,13 @@ public T Class<T>()

public T Struct<T>()
{
return (T)Struct(typeof(T));
var value = Struct(typeof(T));

if (value == null) return default;

return (T)value;
}

public object Struct(Type type)
{
if (type == null) return null;
Expand Down

0 comments on commit 4e620ea

Please sign in to comment.