mirror of
https://github.com/aseprite/aseprite.git
synced 2025-02-06 03:39:51 +00:00
Fix crash when an extension adds a command in a non-existent menu group (fix #3835)
This commit is contained in:
parent
bfe4669c0e
commit
4d3575f4ce
@ -650,8 +650,15 @@ void AppMenus::removeMenuGroup(const std::string& groupId)
|
||||
void AppMenus::addMenuItemIntoGroup(const std::string& groupId,
|
||||
std::unique_ptr<Widget>&& menuItem)
|
||||
{
|
||||
GroupInfo& group = m_groups[groupId];
|
||||
auto it = m_groups.find(groupId);
|
||||
if (it == m_groups.end()) {
|
||||
LOG(ERROR, "MENU: An extension tried to add a command (%s) in a non-existent group (%s)\n",
|
||||
menuItem->text().c_str(), groupId.c_str());
|
||||
menuItem.release();
|
||||
return;
|
||||
}
|
||||
|
||||
GroupInfo& group = it->second;
|
||||
Menu* menu = group.menu;
|
||||
ASSERT(menu);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user