projects
/
shibboleth
/
cpp-xmltooling.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
CPPXT-104 - Add exception handling to integer conversions
[shibboleth/cpp-xmltooling.git]
/
xmltooling
/
util
/
XMLHelper.cpp
diff --git
a/xmltooling/util/XMLHelper.cpp
b/xmltooling/util/XMLHelper.cpp
index
a270de4
..
2682395
100644
(file)
--- a/
xmltooling/util/XMLHelper.cpp
+++ b/
xmltooling/util/XMLHelper.cpp
@@
-338,9
+338,11
@@
int XMLHelper::getAttrInt(const DOMElement* e, int defValue, const XMLCh* localN
if (e) {
const XMLCh* val = e->getAttributeNS(ns, localName);
if (val && *val) {
- int i = XMLString::parseInt(val);
- if (i)
- return i;
+ try {
+ return XMLString::parseInt(val);
+ }
+ catch (XMLException&) {
+ }
}
}
return defValue;