Commit f3f7ca79 authored by Albert Astals Cid's avatar Albert Astals Cid

Fix crash for rects that don't have an action

It shouldn't really happen, but in some cases it does, so be protective

BUGS: 408849
parent 3c6a4fcb
......@@ -4429,8 +4429,13 @@ QMenu* PageView::createProcessLinkMenu(PageViewItem *item, const QPoint &eventPo
const Okular::ObjectRect * rect = item->page()->objectRect( Okular::ObjectRect::Action, nX, nY, item->uncroppedWidth(), item->uncroppedHeight() );
if ( rect )
{
QMenu *menu = new QMenu(this);
const Okular::Action * link = static_cast< const Okular::Action * >( rect->object() );
if (!link)
return nullptr;
QMenu *menu = new QMenu(this);
// creating the menu and its actions
QAction * processLink = menu->addAction( i18n( "Follow This Link" ) );
processLink->setObjectName("ProcessLinkAction");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment