Fix Dereference of a possibly null reference and simplify checks
Fix Dereference of a possibly null reference and simplify checks

AvaloniaUI/Avalonia,AvaloniaUI/Avalonia,AvaloniaUI/Avalonia,AvaloniaUI/Avalonia,AvaloniaUI/Avalonia,AvaloniaUI/Avalonia,AvaloniaUI/Avalonia