summaryrefslogtreecommitdiff
path: root/src/client.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-05-14 03:23:49 +0300
committerAndrei Karas <akaras@inbox.ru>2011-05-14 03:23:49 +0300
commiteedeca17b9867762093e330d68bf21aea9e75fba (patch)
treee1acce6753ffedeff5ea4c80dc3399f6dd0260c9 /src/client.cpp
parent1a04f34a62dc82833dbe994a9f11d543b6a78928 (diff)
downloadmv-eedeca17b9867762093e330d68bf21aea9e75fba.tar.gz
mv-eedeca17b9867762093e330d68bf21aea9e75fba.tar.bz2
mv-eedeca17b9867762093e330d68bf21aea9e75fba.tar.xz
mv-eedeca17b9867762093e330d68bf21aea9e75fba.zip
Add missing checks.
Diffstat (limited to 'src/client.cpp')
-rw-r--r--src/client.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/client.cpp b/src/client.cpp
index 4bd321712..2e44b94b3 100644
--- a/src/client.cpp
+++ b/src/client.cpp
@@ -673,7 +673,8 @@ int Client::exec()
while (get_elapsed_time(lastTickTime) > 0)
{
- gui->logic();
+ if (gui)
+ gui->logic();
if (game)
game->logic();
@@ -689,7 +690,8 @@ int Client::exec()
if (SDL_GetAppState() & SDL_APPACTIVE)
{
frame_count++;
- gui->draw();
+ if (gui)
+ gui->draw();
graphics->updateScreen();
// logger->log("active");
}
@@ -745,8 +747,14 @@ int Client::exec()
else if (mOldState == STATE_START ||
(mOldState == STATE_GAME && mState != STATE_GAME))
{
+ if (!gui)
+ break;
+
gcn::Container *top = static_cast<gcn::Container*>(gui->getTop());
+ if (!top)
+ break;
+
mDesktop = new Desktop;
top->add(mDesktop);
mSetupButton = new Button(_("Setup"), "Setup", this);
@@ -1635,6 +1643,9 @@ void Client::initScreenshotDir()
void Client::accountLogin(LoginData *loginData)
{
+ if (!loginData)
+ return;
+
logger->log("Username is %s", loginData->username.c_str());
// Send login infos