From 7ca0e81184bfea26d7e89b51ae6b1ebc86baf54f Mon Sep 17 00:00:00 2001 From: nowrep Date: Fri, 4 Mar 2011 15:14:35 +0100 Subject: [PATCH] =?UTF-8?q?[Crash=20Fix:]=C2=A0Startup=20crash=20without?= =?UTF-8?q?=20restoring=20session?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/qupzilla.h | 4 ++-- src/webview/tabwidget.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/app/qupzilla.h b/src/app/qupzilla.h index 06c532d42..4edb24dfe 100644 --- a/src/app/qupzilla.h +++ b/src/app/qupzilla.h @@ -96,8 +96,8 @@ public: void showInspector(); void setBackground(QColor textColor); - inline WebView* weView() const { return qobject_cast(m_tabWidget->widget(m_tabWidget->currentIndex()))->view(); } - inline WebView* weView(int index) const { return qobject_cast(m_tabWidget->widget(index))->view(); } + inline WebView* weView() const { WebTab* webTab = qobject_cast(m_tabWidget->widget(m_tabWidget->currentIndex())); if (!webTab) return 0; return webTab->view(); } + inline WebView* weView(int index) const { WebTab* webTab = qobject_cast(m_tabWidget->widget(index)); if (!webTab) return 0; return webTab->view(); } inline LocationBar* locationBar(){ return m_locationBar; } inline TabWidget* tabWidget(){ return m_tabWidget; } inline BookmarksToolbar* bookmarksToolbar(){ return m_bookmarksToolbar; } diff --git a/src/webview/tabwidget.h b/src/webview/tabwidget.h index 5c0ce5300..1372f205d 100644 --- a/src/webview/tabwidget.h +++ b/src/webview/tabwidget.h @@ -68,8 +68,8 @@ private slots: void actionChangeIndex(); private: - inline WebView* weView() { return qobject_cast(widget(currentIndex()))->view(); } - inline WebView* weView(int index) { return qobject_cast(widget(index))->view(); } + inline WebView* weView() { WebTab* webTab = qobject_cast(widget(currentIndex())); if (!webTab) return 0; return webTab->view(); } + inline WebView* weView(int index) { WebTab* webTab = qobject_cast(widget(index)); if (!webTab) return 0; return webTab->view(); } bool m_hideCloseButtonWithOneTab; bool m_hideTabBarWithOneTab;