Browse Source
Merge pull request #3343 from AvaloniaUI/fixes/osx-swallowed-nre-when-window-closes
[OSX] null check to prevent NRE when window closes.
pull/3350/head
Nikita Tsukanov
6 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
5 additions and
0 deletions
-
src/Avalonia.Native/WindowImplBase.cs
|
|
|
@ -353,6 +353,11 @@ namespace Avalonia.Native |
|
|
|
|
|
|
|
public void SetCursor(IPlatformHandle cursor) |
|
|
|
{ |
|
|
|
if (_native == null) |
|
|
|
{ |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
var newCursor = cursor as AvaloniaNativeCursor; |
|
|
|
newCursor = newCursor ?? (_cursorFactory.GetCursor(StandardCursorType.Arrow) as AvaloniaNativeCursor); |
|
|
|
_native.Cursor = newCursor.Cursor; |
|
|
|
|