summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/Disco/CapsManager.cpp')
-rw-r--r--Swiften/Disco/CapsManager.cpp4
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
@@ -44,20 +44,20 @@ void CapsManager::handleStanzaChannelAvailableChanged(bool available) {
if (available) {
failingCaps.clear();
fallbacks.clear();
requestedDiscoInfos.clear();
}
}
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));
std::map<std::string, std::set< std::pair<JID, std::string> > >::iterator i = fallbacks.find(hash);
if (i != fallbacks.end() && !i->second.empty()) {
std::pair<JID,std::string> fallbackAndNode = *i->second.begin();
i->second.erase(i->second.begin());
requestDiscoInfo(fallbackAndNode.first, fallbackAndNode.second, hash);
}