CPPXT-104 - Add exception handling to integer conversions
[shibboleth/cpp-opensaml.git] / saml / binding / impl / ArtifactMap.cpp
index c63c57a..e4bae0e 100644 (file)
@@ -190,7 +190,12 @@ ArtifactMap::ArtifactMap(const DOMElement* e, xmltooling::StorageService* storag
 
         const XMLCh* TTL = e->getAttributeNS(nullptr, artifactTTL);
         if (TTL) {
-            m_artifactTTL = XMLString::parseInt(TTL);
+            try {
+                m_artifactTTL = XMLString::parseInt(TTL);
+            }
+            catch (XMLException&) {
+                m_artifactTTL = 0;
+            }
             if (!m_artifactTTL)
                 m_artifactTTL = 180;
         }