Cocoa: Prevent crash on non-existing cursor. Issue #33478, patch from Anton Kavalenka.

git-svn-id: trunk@57551 -
This commit is contained in:
juha 2018-03-22 13:03:34 +00:00
parent f6c1395ad6
commit a5ca0547dd

View File

@ -1247,6 +1247,7 @@ function TLCLCommonCallback.ResetCursorRects: Boolean;
var
ACursor: TCursor;
View: NSView;
cr:TCocoaCursor;
begin
Result := False;
View := CocoaUtils.GetNSObjectView(Owner);
@ -1261,7 +1262,11 @@ begin
end;
Result := ACursor <> crDefault;
if Result then
View.addCursorRect_cursor(View.visibleRect, TCocoaCursor(Screen.Cursors[ACursor]).Cursor);
begin
cr:=TCocoaCursor(Screen.Cursors[ACursor]);
if assigned(cr) then
View.addCursorRect_cursor(View.visibleRect, cr.Cursor);
end;
end;
end;