mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-29 09:30:37 +02:00
Cocoa/Menu: fix the crash when insert a hidden separator after a visible MenuItem, introduced by e762d9b
, see also #41028
This commit is contained in:
parent
aa2b041e48
commit
fd73e63c77
@ -219,7 +219,9 @@ begin
|
||||
MenuObj := NSObject(AMenuItem.Handle);
|
||||
if MenuObj.isKindOfClass(NSMenuItem) then begin
|
||||
item := NSMenuItem(MenuObj);
|
||||
Parent.insertItem_atIndex(NSMenuItem(item), idx)
|
||||
if idx > Parent.numberOfItems then
|
||||
idx:= Parent.numberOfItems;
|
||||
Parent.insertItem_atIndex(NSMenuItem(item), idx);
|
||||
end
|
||||
else if MenuObj.isKindOfClass(NSMenu) then
|
||||
begin
|
||||
|
Loading…
Reference in New Issue
Block a user