Skip to content

Commit

Permalink
improve Primitive security
Browse files Browse the repository at this point in the history
  • Loading branch information
alec1o committed May 19, 2024
1 parent 015b31e commit b3a2afc
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/extension/Primitive.cs
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,14 @@ internal static (T Value, bool IsError) FromPrimitive<T>(Primitive primitive)
// TODO: struct
}

return ((T)value, value == null);
if (primitive.IsValid)
{
return ((T)value, value == null);
}
else
{
return (default, true);
}
}
}
}

0 comments on commit b3a2afc

Please sign in to comment.