summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/JID/JID.cpp')
-rw-r--r--Swiften/JID/JID.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/Swiften/JID/JID.cpp b/Swiften/JID/JID.cpp
index 653ac6a..66d6ff6 100644
--- a/Swiften/JID/JID.cpp
+++ b/Swiften/JID/JID.cpp
@@ -173,10 +173,6 @@ void JID::nameprepAndSetComponents(const std::string& node, const std::string& d
r.first->second = StringPrep::getPrepared(domain, StringPrep::XMPPNodePrep);
}
domain_ = r.first->second;
- if (domain_.empty()) {
- valid_ = false;
- return;
- }
r = resourcePrepCache.insert(std::make_pair(resource, std::string()));
if (r.second) {
@@ -184,6 +180,11 @@ void JID::nameprepAndSetComponents(const std::string& node, const std::string& d
}
resource_ = r.first->second;
#endif
+
+ if (domain_.empty()) {
+ valid_ = false;
+ return;
+ }
}
catch (const std::exception&) {
valid_ = false;