summaryrefslogtreecommitdiff
path: root/indra/newview/llteleporthistory.cpp
diff options
context:
space:
mode:
authorTofu Linden <tofu.linden@lindenlab.com>2010-04-28 12:41:34 +0100
committerTofu Linden <tofu.linden@lindenlab.com>2010-04-28 12:41:34 +0100
commit47fa4bc01478d5ef0311aa491321bfb397777302 (patch)
tree7d9ab0c14c56ece7b178dc9d8ab67633cd476af0 /indra/newview/llteleporthistory.cpp
parentb740924c9dbb6a5697254ca238e099a62e7054a9 (diff)
parent96df3f3eb1351973d140ba73b507de44b1052c89 (diff)
merge from viewer-trunk
Diffstat (limited to 'indra/newview/llteleporthistory.cpp')
-rw-r--r--indra/newview/llteleporthistory.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/indra/newview/llteleporthistory.cpp b/indra/newview/llteleporthistory.cpp
index dcc85392f7..15684337f4 100644
--- a/indra/newview/llteleporthistory.cpp
+++ b/indra/newview/llteleporthistory.cpp
@@ -136,6 +136,7 @@ void LLTeleportHistory::updateCurrentLocation(const LLVector3d& new_pos)
if (mCurrentItem < 0 || mCurrentItem >= (int) mItems.size()) // sanity check
{
llwarns << "Invalid current item. (this should not happen)" << llendl;
+ llassert(!"Invalid current teleport histiry item");
return;
}
LLVector3 new_pos_local = gAgent.getPosAgentFromGlobal(new_pos);
@@ -166,6 +167,17 @@ void LLTeleportHistory::onHistoryChanged()
void LLTeleportHistory::purgeItems()
{
+ if (mItems.size() == 0) // no entries yet (we're called before login)
+ {
+ // If we don't return here the history will get into inconsistent state, hence:
+ // 1) updateCurrentLocation() will malfunction,
+ // so further teleports will not properly update the history;
+ // 2) mHistoryChangedSignal subscribers will be notified
+ // of such an invalid change. (EXT-6798)
+ // Both should not happen.
+ return;
+ }
+
if (mItems.size() > 0)
{
mItems.erase(mItems.begin(), mItems.end()-1);