1
mirror of https://invent.kde.org/network/falkon.git synced 2024-09-21 09:42:10 +02:00

LocationCompleterView: Make sure focusProxy() is not null

See #2421
This commit is contained in:
David Rosca 2017-08-21 11:16:10 +02:00
parent 08274f5bbe
commit d3153355d7

View File

@ -193,7 +193,9 @@ bool LocationCompleterView::eventFilter(QObject* object, QEvent* event)
break;
} // switch (keyEvent->key())
(static_cast<QObject*>(focusProxy()))->event(keyEvent);
if (focusProxy()) {
(static_cast<QObject*>(focusProxy()))->event(keyEvent);
}
return true;
}
@ -233,7 +235,7 @@ bool LocationCompleterView::eventFilter(QObject* object, QEvent* event)
case QEvent::Move:
case QEvent::Resize: {
QWidget *w = qobject_cast<QWidget*>(object);
if (w && w->isWindow() && w == focusProxy()->window()) {
if (w && w->isWindow() && focusProxy() && w == focusProxy()->window()) {
close();
}
break;