diff options
author | Remko Tronçon <git@el-tramo.be> | 2011-08-28 13:41:22 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2011-08-28 13:41:22 (GMT) |
commit | 17c78efa9452fc0619cbd73e124b66bc1f89fa5e (patch) | |
tree | 97ded26e15292d0f1e4da5079f5bc686b087edd3 /Swiften/Disco/CapsManager.cpp | |
parent | 33af107d8d4ffdeada9ea964fe696af4a23c5b95 (diff) | |
download | swift-contrib-17c78efa9452fc0619cbd73e124b66bc1f89fa5e.zip swift-contrib-17c78efa9452fc0619cbd73e124b66bc1f89fa5e.tar.bz2 |
Check whether disco#info responses are null.
Resolves: #953
Release-Notes: Handle case where clients send null disco#info results.
Diffstat (limited to 'Swiften/Disco/CapsManager.cpp')
-rw-r--r-- | Swiften/Disco/CapsManager.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Swiften/Disco/CapsManager.cpp b/Swiften/Disco/CapsManager.cpp index 63166e6..b08a895 100644 --- a/Swiften/Disco/CapsManager.cpp +++ b/Swiften/Disco/CapsManager.cpp @@ -50,8 +50,8 @@ void CapsManager::handleStanzaChannelAvailableChanged(bool available) { void CapsManager::handleDiscoInfoReceived(const JID& from, const std::string& hash, DiscoInfo::ref discoInfo, ErrorPayload::ref error) { requestedDiscoInfos.erase(hash); - if (error || CapsInfoGenerator("").generateCapsInfo(*discoInfo.get()).getVersion() != hash) { - if (warnOnInvalidHash && !error) { + if (error || !discoInfo || CapsInfoGenerator("").generateCapsInfo(*discoInfo.get()).getVersion() != hash) { + if (warnOnInvalidHash && !error && discoInfo) { std::cerr << "Warning: Caps from " << from.toString() << " do not verify" << std::endl; } failingCaps.insert(std::make_pair(from, hash)); |