| Index: chrome/browser/ui/browser.cc | 
| diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc | 
| index b80ef61bdb366294efe5757bcd2844d918f83776..254c356e6576d079e0da0bd89a85e05b63688c6c 100644 | 
| --- a/chrome/browser/ui/browser.cc | 
| +++ b/chrome/browser/ui/browser.cc | 
| @@ -1291,6 +1291,9 @@ void Browser::Home(WindowOpenDisposition disposition) { | 
| void Browser::OpenCurrentURL() { | 
| UserMetrics::RecordAction(UserMetricsAction("LoadURL"), profile_); | 
| LocationBar* location_bar = window_->GetLocationBar(); | 
| +  if(!location_bar) | 
| +    return; | 
| + | 
| WindowOpenDisposition open_disposition = | 
| location_bar->GetWindowOpenDisposition(); | 
| if (OpenInstant(open_disposition)) | 
| @@ -3876,9 +3879,11 @@ void Browser::ProcessPendingUIUpdates() { | 
| if (contents == GetSelectedTabContents()) { | 
| // Updates that only matter when the tab is selected go here. | 
|  | 
| -      if (flags & TabContents::INVALIDATE_PAGE_ACTIONS) | 
| -        window()->GetLocationBar()->UpdatePageActions(); | 
| - | 
| +      if (flags & TabContents::INVALIDATE_PAGE_ACTIONS) { | 
| +        LocationBar* location_bar = window()->GetLocationBar(); | 
| +        if(location_bar) | 
| +          location_bar->UpdatePageActions(); | 
| +      } | 
| // Updating the URL happens synchronously in ScheduleUIUpdate. | 
| if (flags & TabContents::INVALIDATE_LOAD && GetStatusBubble()) { | 
| GetStatusBubble()->SetStatus( | 
| @@ -4205,8 +4210,11 @@ void Browser::TabDetachedAtImpl(TabContentsWrapper* contents, int index, | 
| // is the selected tab.  Because saving state can conditionally revert the | 
| // location bar, saving the current tab's location bar state to a | 
| // non-selected tab can corrupt both tabs. | 
| -    if (contents == GetSelectedTabContentsWrapper()) | 
| -      window_->GetLocationBar()->SaveStateToContents(contents->tab_contents()); | 
| +    if (contents == GetSelectedTabContentsWrapper()) { | 
| +      LocationBar* location_bar = window()->GetLocationBar(); | 
| +      if(location_bar) | 
| +        location_bar->SaveStateToContents(contents->tab_contents()); | 
| +    } | 
|  | 
| if (!tab_handler_->GetTabStripModel()->closing_all()) | 
| SyncHistoryWithTabs(0); | 
|  |