mirror of
https://github.com/vcmi/vcmi.git
synced 2024-11-28 08:48:48 +02:00
client/NetpacksClient.cpp: Called C++ object pointer is null
Null pointers should not be dereferenced
This commit is contained in:
parent
03835236fb
commit
d2c03773cd
@ -367,19 +367,27 @@ void ApplyClientNetPackVisitor::visitGiveBonus(GiveBonus & pack)
|
||||
void ApplyFirstClientNetPackVisitor::visitChangeObjPos(ChangeObjPos & pack)
|
||||
{
|
||||
CGObjectInstance *obj = gs.getObjInstance(pack.objid);
|
||||
if(CGI->mh)
|
||||
CGI->mh->onObjectFadeOut(obj, pack.initiator);
|
||||
|
||||
CGI->mh->waitForOngoingAnimations();
|
||||
if(CGI)
|
||||
{
|
||||
if(CGI->mh)
|
||||
{
|
||||
CGI->mh->onObjectFadeOut(obj, pack.initiator);
|
||||
CGI->mh->waitForOngoingAnimations();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ApplyClientNetPackVisitor::visitChangeObjPos(ChangeObjPos & pack)
|
||||
{
|
||||
CGObjectInstance *obj = gs.getObjInstance(pack.objid);
|
||||
if(CGI->mh)
|
||||
CGI->mh->onObjectFadeIn(obj, pack.initiator);
|
||||
|
||||
CGI->mh->waitForOngoingAnimations();
|
||||
if(CGI)
|
||||
{
|
||||
if(CGI->mh)
|
||||
{
|
||||
CGI->mh->onObjectFadeIn(obj, pack.initiator);
|
||||
CGI->mh->waitForOngoingAnimations();
|
||||
}
|
||||
}
|
||||
cl.invalidatePaths();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user