From 89dd7d47dabcc52a56a89d9ac5246582fa1b138c Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 17 Jul 2015 13:55:59 +0300 Subject: Add missing checks into logindialog and xml. --- src/gui/windows/logindialog.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'src/gui/windows/logindialog.cpp') diff --git a/src/gui/windows/logindialog.cpp b/src/gui/windows/logindialog.cpp index 47e86471e..93bf10bc3 100644 --- a/src/gui/windows/logindialog.cpp +++ b/src/gui/windows/logindialog.cpp @@ -94,7 +94,8 @@ LoginDialog::LoginDialog(LoginData &data, setCloseButton(true); setWindowName("Login"); - charServerHandler->clear(); + if (charServerHandler) + charServerHandler->clear(); // TRANSLATORS: login dialog label Label *const serverLabel1 = new Label(this, _("Server:")); @@ -191,8 +192,15 @@ void LoginDialog::postInit() mPassField->requestFocus(); mLoginButton->setEnabled(canSubmit()); - mRegisterButton->setEnabled(loginHandler->isRegistrationEnabled() - || !mLoginData->registerUrl.empty()); + if (loginHandler) + { + mRegisterButton->setEnabled(loginHandler->isRegistrationEnabled() + || !mLoginData->registerUrl.empty()); + } + else + { + mRegisterButton->setEnabled(false); + } } LoginDialog::~LoginDialog() -- cgit v1.2.3-70-g09d2