QMenu check for null result from QPlatformMenu::menuItemForTag
QMenu needs to check result of QPlatformMenu::menuItemForTag to avoid a crash dereferencing a null pointer. Task-number: QTBUG-42327 Change-Id: Ie54a94caec7a5d756c459741df182fbe4e38bec0 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
This commit is contained in:
parent
063a544616
commit
8a9addf42e
@ -3055,8 +3055,10 @@ void QMenu::actionEvent(QActionEvent *e)
|
||||
delete menuItem;
|
||||
} else if (e->type() == QEvent::ActionChanged) {
|
||||
QPlatformMenuItem *menuItem = d->platformMenu->menuItemForTag(reinterpret_cast<quintptr>(e->action()));
|
||||
copyActionToPlatformItem(e->action(), menuItem);
|
||||
d->platformMenu->syncMenuItem(menuItem);
|
||||
if (menuItem) {
|
||||
copyActionToPlatformItem(e->action(), menuItem);
|
||||
d->platformMenu->syncMenuItem(menuItem);
|
||||
}
|
||||
}
|
||||
|
||||
d->platformMenu->syncSeparatorsCollapsible(d->collapsibleSeparators);
|
||||
|
Loading…
Reference in New Issue
Block a user