Check for optional attributes before assignment.
authorcantor <cantor@cb58f699-b61c-0410-a6fe-9272a202ed29>
Fri, 27 Jun 2003 22:13:10 +0000 (22:13 +0000)
committercantor <cantor@cb58f699-b61c-0410-a6fe-9272a202ed29>
Fri, 27 Jun 2003 22:13:10 +0000 (22:13 +0000)
git-svn-id: https://svn.middleware.georgetown.edu/cpp-sp/trunk@563 cb58f699-b61c-0410-a6fe-9272a202ed29

shib/AAP.cpp

index 245dcdf..a8b6adc 100644 (file)
@@ -199,15 +199,15 @@ void XMLAAPImpl::regAttributes() const
         else
         {
             saml::NDC ndc("regAttributes");
-            Category::getInstance(SHIB_LOGCAT".XMLAAPImpl").error("do not support custom attribute factories yet");
+            Category::getInstance(SHIB_LOGCAT".XMLAAPImpl").error("unknown attribute factory: %s", i->second->getFactory());
         }
     }
 }
 
 XMLAAPImpl::AttributeRule::AttributeRule(const DOMElement* e) :
-    m_factory(XMLString::transcode(e->getAttributeNS(NULL,SHIB_L(Factory)))),
-    m_alias(XMLString::transcode(e->getAttributeNS(NULL,SHIB_L(Alias)))),
-    m_header(XMLString::transcode(e->getAttributeNS(NULL,SHIB_L(Header))))
+    m_factory(e->hasAttributeNS(NULL,SHIB_L(Factory)) ? XMLString::transcode(e->getAttributeNS(NULL,SHIB_L(Factory))) : NULL),
+    m_alias(e->hasAttributeNS(NULL,SHIB_L(Alias)) ? XMLString::transcode(e->getAttributeNS(NULL,SHIB_L(Alias))) : NULL),
+    m_header(e->hasAttributeNS(NULL,SHIB_L(Header)) ? XMLString::transcode(e->getAttributeNS(NULL,SHIB_L(Header))) : NULL)
     
 {
     m_name=e->getAttributeNS(NULL,SHIB_L(Name));