Convert logging to log4shib via compile time switch.
[shibboleth/cpp-sp.git] / shibsp / attribute / resolver / impl / XMLAttributeExtractor.cpp
index 1604055..44bf5e4 100644 (file)
@@ -39,7 +39,6 @@ using namespace shibsp;
 using namespace opensaml::saml2md;
 using namespace opensaml;
 using namespace xmltooling;
-using namespace log4cpp;
 using namespace std;
 using saml1::NameIdentifier;
 using saml2::NameID;
@@ -250,12 +249,9 @@ void XMLExtractorImpl::extractAttributes(
     auto_ptr_char temp(format);
     if ((rule=m_attrMap.find(make_pair(temp.get(),string()))) != m_attrMap.end()) {
 #endif
-        attributes.insert(
-            make_pair(
-                rule->second.second,
-                rule->second.first->decode(rule->second.second.c_str(), &nameid, assertingParty, application.getString("entityID").second)
-                )
-            );
+        Attribute* a = rule->second.first->decode(rule->second.second.c_str(), &nameid, assertingParty, application.getString("entityID").second);
+        if (a)
+            attributes.insert(make_pair(rule->second.second, a));
     }
 }
 
@@ -278,12 +274,9 @@ void XMLExtractorImpl::extractAttributes(
     auto_ptr_char temp(format);
     if ((rule=m_attrMap.find(make_pair(temp.get(),string()))) != m_attrMap.end()) {
 #endif
-        attributes.insert(
-            make_pair(
-                rule->second.second,
-                rule->second.first->decode(rule->second.second.c_str(), &nameid, assertingParty, application.getString("entityID").second)
-                )
-            );
+        Attribute* a = rule->second.first->decode(rule->second.second.c_str(), &nameid, assertingParty, application.getString("entityID").second);
+        if (a)
+            attributes.insert(make_pair(rule->second.second, a));
     }
 }
 
@@ -310,12 +303,9 @@ void XMLExtractorImpl::extractAttributes(
     auto_ptr_char temp2(format);
     if ((rule=m_attrMap.find(make_pair(temp1.get(),temp2.get()))) != m_attrMap.end()) {
 #endif
-        attributes.insert(
-            make_pair(
-                rule->second.second,
-                rule->second.first->decode(rule->second.second.c_str(), &attr, assertingParty, application.getString("entityID").second)
-                )
-            );
+        Attribute* a = rule->second.first->decode(rule->second.second.c_str(), &attr, assertingParty, application.getString("entityID").second);
+        if (a)
+            attributes.insert(make_pair(rule->second.second, a));
     }
 }
 
@@ -344,12 +334,9 @@ void XMLExtractorImpl::extractAttributes(
     auto_ptr_char temp2(format);
     if ((rule=m_attrMap.find(make_pair(temp1.get(),temp2.get()))) != m_attrMap.end()) {
 #endif
-        attributes.insert(
-            make_pair(
-                rule->second.second,
-                rule->second.first->decode(rule->second.second.c_str(), &attr, assertingParty, application.getString("entityID").second)
-                )
-            );
+        Attribute* a = rule->second.first->decode(rule->second.second.c_str(), &attr, assertingParty, application.getString("entityID").second);
+        if (a)
+            attributes.insert(make_pair(rule->second.second, a));
     }
 }