createStandardContextMenu can return null; guard against that

BUG:246018

svn path=/trunk/KDE/kdelibs/; revision=1156698
This commit is contained in:
Aaron J. Seigo 2010-07-29 14:49:06 +00:00
parent e57e1b8c80
commit 87a29d9efc

View File

@ -182,8 +182,10 @@ void TextBrowser::dataUpdated(const QString &sourceName, const Plasma::DataEngin
void TextBrowser::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
{
QMenu *popup = nativeWidget()->createStandardContextMenu(event->screenPos());
popup->exec(event->screenPos());
delete popup;
if (popup) {
popup->exec(event->screenPos());
delete popup;
}
}
void TextBrowser::resizeEvent(QGraphicsSceneResizeEvent *event)