From 94ccbc6bf030b9140fdeb4bbf9aee2e5057493ea Mon Sep 17 00:00:00 2001 From: "timeless%mozdev.org" Date: Sun, 27 Nov 2005 23:51:42 +0000 Subject: [PATCH] Bug 317877 XBL: crash if has no name attribute [@ nsCharTraits::length] patch by ajschult@verizon.net r=bz sr=bz git-svn-id: svn://10.0.0.236/trunk@185310 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/content/xbl/src/nsXBLContentSink.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/mozilla/content/xbl/src/nsXBLContentSink.cpp b/mozilla/content/xbl/src/nsXBLContentSink.cpp index 21f824c0f4d..e565620ca1a 100644 --- a/mozilla/content/xbl/src/nsXBLContentSink.cpp +++ b/mozilla/content/xbl/src/nsXBLContentSink.cpp @@ -766,12 +766,14 @@ nsXBLContentSink::ConstructField(const PRUnichar **aAtts, PRUint32 aLineNumber) } } - // All of our pointers are now filled in. Construct our field with all of - // these parameters. - mField = new nsXBLProtoImplField(name, readonly); - if (mField) { - mField->SetLineNumber(aLineNumber); - AddMember(mField); + if (name) { + // All of our pointers are now filled in. Construct our field with all of + // these parameters. + mField = new nsXBLProtoImplField(name, readonly); + if (mField) { + mField->SetLineNumber(aLineNumber); + AddMember(mField); + } } }