summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2011-08-28 12:06:32 (GMT)
committerRemko Tronçon <git@el-tramo.be>2011-08-28 12:06:32 (GMT)
commit730b88ce48471842333b8769bcfc017335b0440f (patch)
tree3b4c2470fb5bc250d707638520348944e46fe6cf /Swift/Controllers
parent063dc0412e0f84c779f133ec7293873b76f6b2d0 (diff)
parent33af107d8d4ffdeada9ea964fe696af4a23c5b95 (diff)
downloadswift-730b88ce48471842333b8769bcfc017335b0440f.zip
swift-730b88ce48471842333b8769bcfc017335b0440f.tar.bz2
Merge remote branch 'origin/swift-1.x'
* swift-1.x: Catch boost file system errors when reading VCards. Conflicts: Swift/Controllers/Storages/VCardFileStorage.cpp
Diffstat (limited to 'Swift/Controllers')
-rw-r--r--Swift/Controllers/Storages/VCardFileStorage.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/Swift/Controllers/Storages/VCardFileStorage.cpp b/Swift/Controllers/Storages/VCardFileStorage.cpp
index 5f657a4..3dff06f 100644
--- a/Swift/Controllers/Storages/VCardFileStorage.cpp
+++ b/Swift/Controllers/Storages/VCardFileStorage.cpp
@@ -61,9 +61,15 @@ void VCardFileStorage::setVCard(const JID& jid, VCard::ref v) {
}
boost::filesystem::path VCardFileStorage::getVCardPath(const JID& jid) const {
- std::string file(jid.toString());
- String::replaceAll(file, '/', "%2f");
- return boost::filesystem::path(vcardsPath / (file + ".xml"));
+ try {
+ std::string file(jid.toString());
+ String::replaceAll(file, '/', "%2f");
+ return boost::filesystem::path(vcardsPath / (file + ".xml"));
+ }
+ catch (const boost::filesystem::filesystem_error& e) {
+ std::cerr << "ERROR: " << e.what() << std::endl;
+ return boost::filesystem::path();
+ }
}
std::string VCardFileStorage::getPhotoHash(const JID& jid) const {