Bustage fix (assertion failure) for bug 319004, handle empty title

This commit is contained in:
ajschult%verizon.net 2006-01-06 03:25:11 +00:00
Родитель 348b6d247f
Коммит eec0e5a3b5
2 изменённых файлов: 4 добавлений и 2 удалений

Просмотреть файл

@ -1119,7 +1119,8 @@ nsGlobalHistory::SetPageTitle(nsIURI *aURI, const nsAString& aTitle)
NS_ENSURE_ARG_POINTER(aURI);
nsAutoString titleString(StringHead(aTitle, HISTORY_TITLE_LENGTH_MAX));
if (IS_HIGH_SURROGATE(titleString.Last()))
if (titleString.Length() < aTitle.Length() &&
IS_HIGH_SURROGATE(titleString.Last()))
titleString.Truncate(titleString.Length()-1);
// skip about: URIs to avoid reading in the db (about:blank, especially)

Просмотреть файл

@ -1042,7 +1042,8 @@ nsGlobalHistory::SetPageTitle(nsIURI *aURI, const nsAString& aTitle)
NS_ENSURE_ARG_POINTER(aURI);
nsAutoString titleString(StringHead(aTitle, HISTORY_TITLE_LENGTH_MAX));
if (IS_HIGH_SURROGATE(titleString.Last()))
if (titleString.Length() < aTitle.Length() &&
IS_HIGH_SURROGATE(titleString.Last()))
titleString.Truncate(titleString.Length()-1);
// skip about: URIs to avoid reading in the db (about:blank, especially)