Browse Source

Merge pull request #10810 from timunie/fix/ThemeVariant_NRE

Attempt to fix possible NRE
pull/10828/head
Max Katz 4 years ago
committed by GitHub
parent
commit
80188994bd
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      src/Avalonia.Controls/TopLevel.cs

3
src/Avalonia.Controls/TopLevel.cs

@ -459,7 +459,8 @@ namespace Avalonia.Controls
}
else if (change.Property == ActualThemeVariantProperty)
{
PlatformImpl?.SetFrameThemeVariant((PlatformThemeVariant?)change.GetNewValue<ThemeVariant>() ?? PlatformThemeVariant.Light);
var newThemeVariant = change.GetNewValue<ThemeVariant?>() ?? ThemeVariant.Default;
PlatformImpl?.SetFrameThemeVariant((PlatformThemeVariant?)newThemeVariant ?? PlatformThemeVariant.Light);
}
}

Loading…
Cancel
Save