summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDastgir <dastgirp@gmail.com>2018-09-02 11:36:16 +0530
committerDastgir <dastgirp@gmail.com>2018-09-02 11:36:16 +0530
commit1c2e90a46f6b3449dd83fab490cfcb747d3b3356 (patch)
tree8192eaeb3c012dc6e808aede68193aed5cfe2b03
parent611bda248b3cb221bef4ad81f74c0508a76095d9 (diff)
downloadhercules-1c2e90a46f6b3449dd83fab490cfcb747d3b3356.tar.gz
hercules-1c2e90a46f6b3449dd83fab490cfcb747d3b3356.tar.bz2
hercules-1c2e90a46f6b3449dd83fab490cfcb747d3b3356.tar.xz
hercules-1c2e90a46f6b3449dd83fab490cfcb747d3b3356.zip
Fixes #2173
Fixes crash when character is removed from `char` table but not from guild_member.
-rw-r--r--src/char/int_guild.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/char/int_guild.c b/src/char/int_guild.c
index e03278fad..56e1c1ba3 100644
--- a/src/char/int_guild.c
+++ b/src/char/int_guild.c
@@ -443,7 +443,9 @@ static struct guild *inter_guild_fromsql(int guild_id)
if( m->position >= MAX_GUILDPOSITION ) // Fix reduction of MAX_GUILDPOSITION [PoW]
m->position = MAX_GUILDPOSITION - 1;
SQL->GetData(inter->sql_handle, 11, &data, &len); memcpy(m->name, data, min(len, NAME_LENGTH));
- SQL->GetData(inter->sql_handle, 12, &data, NULL); m->last_login = atoi(data);
+ SQL->GetData(inter->sql_handle, 12, &data, NULL);
+ if (data != NULL)
+ m->last_login = atoi(data);
m->modified = GS_MEMBER_UNMODIFIED;
}