summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Swiften/Client/Client.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/Swiften/Client/Client.cpp b/Swiften/Client/Client.cpp
index 874e23b..3962281 100644
--- a/Swiften/Client/Client.cpp
+++ b/Swiften/Client/Client.cpp
@@ -89,6 +89,10 @@ void Client::closeConnection() {
}
void Client::send(boost::shared_ptr<Stanza> stanza) {
+ if (!isAvailable()) {
+ std::cerr << "Warning: Client: Trying to send a stanza while disconnected." << std::endl;
+ return;
+ }
session_->sendElement(stanza);
}
@@ -189,6 +193,7 @@ void Client::handleSessionFinished(boost::shared_ptr<Error> error) {
}
void Client::handleNeedCredentials() {
+ assert(session_);
session_->sendCredentials(password_);
}