From 8061d9ebfffff91d7a4fc1b8a2d8823aa36a83c2 Mon Sep 17 00:00:00 2001 From: stippi Date: Wed, 7 Apr 2010 12:46:39 +0000 Subject: [PATCH] In BrowserWindow::_TabChanged(), the BWebView could be NULL. Also check if there is a focused view set at all. git-svn-id: http://svn.haiku-os.org/webpositive/webkit/trunk@398 94f232f2-1747-11df-bad5-a5bfde151594 --- src/apps/webpositive/BrowserWindow.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/apps/webpositive/BrowserWindow.cpp b/src/apps/webpositive/BrowserWindow.cpp index a5d8fa2671..c8369b2af1 100644 --- a/src/apps/webpositive/BrowserWindow.cpp +++ b/src/apps/webpositive/BrowserWindow.cpp @@ -1228,17 +1228,19 @@ BrowserWindow::_TabChanged(int32 index) SetCurrentWebView(webView); - PageUserData* userData = static_cast(webView->GetUserData()); - if (userData) - userData->FocusedView()->MakeFocus(true); - else - webView->MakeFocus(true); - if (webView) _UpdateTitle(webView->MainFrameTitle()); else _UpdateTitle(""); + if (webView) { + PageUserData* userData = static_cast( + webView->GetUserData()); + if (userData && userData->FocusedView() != NULL) + userData->FocusedView()->MakeFocus(true); + else + webView->MakeFocus(true); + fURLTextControl->SetText(webView->MainFrameURL()); // Trigger update of the interface to the new page, by requesting // to resend all notifications.