diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-07-17 13:55:59 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-07-17 13:55:59 +0300 |
commit | 89dd7d47dabcc52a56a89d9ac5246582fa1b138c (patch) | |
tree | c795eb2a2c218029de17e0ca40ea8b6d00dc3c81 /src/gui/windows/logindialog.cpp | |
parent | 420c7c31f6ac97741feaf9f34e641ec0d6e0fdf5 (diff) | |
download | manaverse-89dd7d47dabcc52a56a89d9ac5246582fa1b138c.tar.gz manaverse-89dd7d47dabcc52a56a89d9ac5246582fa1b138c.tar.bz2 manaverse-89dd7d47dabcc52a56a89d9ac5246582fa1b138c.tar.xz manaverse-89dd7d47dabcc52a56a89d9ac5246582fa1b138c.zip |
Add missing checks into logindialog and xml.
Diffstat (limited to 'src/gui/windows/logindialog.cpp')
-rw-r--r-- | src/gui/windows/logindialog.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
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() |