summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/Parser/PayloadParsers/PriorityParser.cpp')
-rw-r--r--Swiften/Parser/PayloadParsers/PriorityParser.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/Swiften/Parser/PayloadParsers/PriorityParser.cpp b/Swiften/Parser/PayloadParsers/PriorityParser.cpp
index 7bf81bf..8872977 100644
--- a/Swiften/Parser/PayloadParsers/PriorityParser.cpp
+++ b/Swiften/Parser/PayloadParsers/PriorityParser.cpp
@@ -20,7 +20,13 @@ void PriorityParser::handleStartElement(const String&, const String&, const Attr
void PriorityParser::handleEndElement(const String&, const String&) {
--level_;
if (level_ == 0) {
- getPayloadInternal()->setPriority(boost::lexical_cast<int>(text_));
+ int priority = 0;
+ try {
+ priority = boost::lexical_cast<int>(text_);
+ }
+ catch (boost::bad_lexical_cast& e) {
+ }
+ getPayloadInternal()->setPriority(priority);
}
}