Bug 184697: Return an element-factory even for the unknown namespace to avoid crash.

r=harishd sr=heikki
This commit is contained in:
sicking%bigfoot.com 2003-01-15 22:45:39 +00:00
Родитель 9d56c19334
Коммит e4a2e08be6
1 изменённых файлов: 9 добавлений и 0 удалений

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

@ -461,6 +461,15 @@ NameSpaceManagerImpl::GetElementFactory(PRInt32 aNameSpaceID,
{
*aElementFactory = nsnull;
// Parsing should have aborted before we get here, but for now we'll have to
// live with returning the default factory. Bugs 184697 and 103255
if (aNameSpaceID == kNameSpaceID_Unknown) {
*aElementFactory = mDefaultElementFactory;
NS_ADDREF(*aElementFactory);
return NS_OK;
}
NS_ENSURE_TRUE(aNameSpaceID >= 0, NS_ERROR_ILLEGAL_VALUE);
if (aNameSpaceID < mElementFactoryArray.Count()) {