Skip to content

Commit

Permalink
[8565] Fixed crash added in [8560]. Thx to KAPATEJIb.
Browse files Browse the repository at this point in the history
Signed-off-by: Triply <triply@getmangos.com>
  • Loading branch information
triply committed Sep 29, 2009
1 parent 9a6d14a commit 25f5e7c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/game/ArenaTeam.cpp
Expand Up @@ -198,6 +198,9 @@ bool ArenaTeam::LoadMembersFromDB(QueryResult *arenaTeamMembersResult)
do
{
Field *fields = arenaTeamMembersResult->Fetch();
//prevent crash if db records are broken, when all members in result are already processed and current team hasn't got any members
if (!fields)
break;
uint32 arenaTeamId = fields[0].GetUInt32();
if (arenaTeamId < m_TeamId)
{
Expand Down
9 changes: 9 additions & 0 deletions src/game/Guild.cpp
Expand Up @@ -290,6 +290,9 @@ bool Guild::LoadRanksFromDB(QueryResult *guildRanksResult)
do
{
fields = guildRanksResult->Fetch();
//condition that would be true when all ranks in QueryResult will be processed and guild without ranks is being processed
if (!fields)
break;

uint32 guildId = fields[0].GetUInt32();
if (guildId < m_Id)
Expand Down Expand Up @@ -352,6 +355,9 @@ bool Guild::LoadMembersFromDB(QueryResult *guildMembersResult)
do
{
Field *fields = guildMembersResult->Fetch();
//this condition will be true when all rows in QueryResult are processed and new guild without members is going to be loaded - prevent crash
if (!fields)
break;
uint32 guildId = fields[0].GetUInt32();
if (guildId < m_Id)
{
Expand Down Expand Up @@ -1461,6 +1467,9 @@ bool Guild::LoadBankRightsFromDB(QueryResult *guildBankTabRightsResult)
do
{
Field *fields = guildBankTabRightsResult->Fetch();
//prevent crash when all rights in result are already processed
if (!fields)
break;
uint32 guildId = fields[0].GetUInt32();
if (guildId < m_Id)
{
Expand Down
2 changes: 1 addition & 1 deletion src/shared/revision_nr.h
@@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "8564"
#define REVISION_NR "8565"
#endif // __REVISION_NR_H__

0 comments on commit 25f5e7c

Please sign in to comment.