diff --git a/indra/newview/llbottomtray.cpp b/indra/newview/llbottomtray.cpp
index 9c8482c35ddb63c30b3298b055747425ea162006..33d006578ddd0e61c153f75b97bcbd80f15dcc04 100644
--- a/indra/newview/llbottomtray.cpp
+++ b/indra/newview/llbottomtray.cpp
@@ -161,12 +161,14 @@ class LLBottomTrayLite
 		mGesturePanel = getChild<LLPanel>("gesture_panel");
 
 		// Hide "show_nearby_chat" button 
-		LLLineEditor* chat_box = mNearbyChatBar->getChatBox();
-		LLUICtrl* show_btn = mNearbyChatBar->getChild<LLUICtrl>("show_nearby_chat");
-		S32 delta_width = show_btn->getRect().getWidth();
-		show_btn->setVisible(FALSE);
-		chat_box->reshape(chat_box->getRect().getWidth() + delta_width, chat_box->getRect().getHeight());
-
+		if (mNearbyChatBar)
+		{
+			LLLineEditor* chat_box = mNearbyChatBar->getChatBox();
+			LLUICtrl* show_btn = mNearbyChatBar->getChild<LLUICtrl>("show_nearby_chat");
+			S32 delta_width = show_btn->getRect().getWidth();
+			show_btn->setVisible(FALSE);
+			chat_box->reshape(chat_box->getRect().getWidth() + delta_width, chat_box->getRect().getHeight());
+		}
 		return TRUE;
 	}
 
@@ -226,7 +228,7 @@ LLBottomTray::LLBottomTray(const LLSD&)
 	}
 
 	mImageDragIndication = LLUI::getUIImage(getString("DragIndicationImageName"));
-	mDesiredNearbyChatWidth = getChild<LLNearbyChatBar>("chat_bar")->getRect().getWidth();
+	mDesiredNearbyChatWidth = mNearbyChatBar ? mNearbyChatBar->getRect().getWidth() : 0;
 }
 
 LLBottomTray::~LLBottomTray()
diff --git a/indra/newview/llnearbychathandler.cpp b/indra/newview/llnearbychathandler.cpp
index f141817b3fa2abaf357de5f2998c131929c7bb15..47d32e57fbef76394c36831343effdd4e6b26760 100644
--- a/indra/newview/llnearbychathandler.cpp
+++ b/indra/newview/llnearbychathandler.cpp
@@ -154,7 +154,7 @@ class LLNearbyChatToast : public LLToast
 
 void LLNearbyChatScreenChannel::deactivateToast(LLToast* toast)
 {
-	std::vector<LLToast*>::iterator pos = std::find(m_active_toasts.begin(), m_active_toasts.end(), toast);
+	toast_vec_t::iterator pos = std::find(m_active_toasts.begin(), m_active_toasts.end(), toast->getHandle());
 
 	if (pos == m_active_toasts.end())
 	{