From 37b95a4e10ca0af39a03b17e974baf72f1b4c7c7 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Fri, 27 Jul 2012 08:55:21 +0200 Subject: Fix sneaky crash of user agent menu BUG: 303862 --- src/mainwindow.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/mainwindow.cpp') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index ad11e1af..7e42e6c1 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -1598,7 +1598,19 @@ void MainWindow::closeEvent(QCloseEvent *event) void MainWindow::populateUserAgentMenu() { KMenu *uaMenu = static_cast(QObject::sender()); - rApp->userAgentManager()->populateUAMenuForTabUrl(uaMenu, currentTab()); + if (!uaMenu) + { + kDebug() << "oops... NO user agent menu"; + return; + } + WebTab *w = currentTab(); + if (!w) + { + kDebug() << "oh oh... NO current tab. What is it happening here???"; + return; + } + + rApp->userAgentManager()->populateUAMenuForTabUrl(uaMenu, w); } -- cgit v1.2.1