Fix crash when trying to decode NULL this pointer
When the this pointer is set to ThisPointer_CBaseEntity and the address is null, just return INVALID_ENT_REFERENCE instead of trying to access the pointer.
This commit is contained in:
parent
274b4276c0
commit
076d40510c
@ -381,6 +381,8 @@ cell_t GetThisPtr(void *iface, ThisPointerType type)
|
|||||||
{
|
{
|
||||||
if(type == ThisPointer_CBaseEntity)
|
if(type == ThisPointer_CBaseEntity)
|
||||||
{
|
{
|
||||||
|
if (!iface)
|
||||||
|
return -1;
|
||||||
return gamehelpers->EntityToBCompatRef((CBaseEntity *)iface);
|
return gamehelpers->EntityToBCompatRef((CBaseEntity *)iface);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user