Skip to content

Commit

Permalink
fix: Fix potential crash in PropertyValue.AreEqualImpl
Browse files Browse the repository at this point in the history
(cherry picked from commit 5541236)
  • Loading branch information
Youssef1313 authored and mergify[bot] committed Oct 16, 2024
1 parent 0e83d1d commit 840d448
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Uno.Foundation/PropertyValue.Internal.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ bool CompareOtherType()
//}
if (oldValueType.IsEnum)
{
return oldValue switch
var oldValueUnwrapped = Convert.ChangeType(oldValue, oldValueType.GetEnumUnderlyingType());
return oldValueUnwrapped switch
{
byte oldValueAsByte => oldValueAsByte == (byte)newValue,
sbyte oldValueAsSByte => oldValueAsSByte == (sbyte)newValue,
Expand Down

0 comments on commit 840d448

Please sign in to comment.