mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-24 22:14:36 +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