diff options
author | Remko Tronçon <git@el-tramo.be> | 2011-08-28 12:06:32 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2011-08-28 12:06:32 (GMT) |
commit | 730b88ce48471842333b8769bcfc017335b0440f (patch) | |
tree | 3b4c2470fb5bc250d707638520348944e46fe6cf /Swift/Controllers/Storages | |
parent | 063dc0412e0f84c779f133ec7293873b76f6b2d0 (diff) | |
parent | 33af107d8d4ffdeada9ea964fe696af4a23c5b95 (diff) | |
download | swift-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/Storages')
-rw-r--r-- | Swift/Controllers/Storages/VCardFileStorage.cpp | 12 |
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 { |