From f954db02638e32677d5fe61abdf0079b434d725c Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Mon, 5 Jul 2010 11:54:50 +0100 Subject: Checker: FORWARD_NULL Function: LLChatHistory::appendMessage(const LLChat &, const LLSD &, const LLStyle::Params &) File: /indra/newview/llchathistory.cpp --- indra/newview/llchathistory.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'indra') diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index ac12bffdfb..c0fa910f86 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -557,11 +557,14 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL { bool use_plain_text_chat_history = args["use_plain_text_chat_history"].asBoolean(); - if(mEditor) + llassert(mEditor); + if (!mEditor) { - mEditor->setPlainText(use_plain_text_chat_history); + return; } + mEditor->setPlainText(use_plain_text_chat_history); + if (!mEditor->scrolledToEnd() && chat.mFromID != gAgent.getID() && !chat.mFromName.empty()) { mUnreadChatSources.insert(chat.mFromName); @@ -740,7 +743,7 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL mIsLastMessageFromLog = message_from_log; } - if (chat.mNotifId.notNull()) + if (chat.mNotifId.notNull()) { LLNotificationPtr notification = LLNotificationsUtil::find(chat.mNotifId); if (notification != NULL) @@ -832,6 +835,7 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL mEditor->appendText(message, FALSE, style_params); } + mEditor->blockUndo(); // automatically scroll to end when receiving chat from myself -- cgit v1.2.3