CPPXT-104 - Add exception handling to integer conversions
authorScott Cantor <cantor.2@osu.edu>
Sun, 5 Jul 2015 19:12:30 +0000 (19:12 +0000)
committerScott Cantor <cantor.2@osu.edu>
Sun, 5 Jul 2015 19:12:30 +0000 (19:12 +0000)
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;
         }