Skip to content

No way to check if pointer is pointing to a null value for CBaseEntity and Edict type of param #15

@GAMMACASE

Description

@GAMMACASE

Currently you can only check if the address itself is a null if I'm reading the code here correctly, but when you are getting a param of a type CBaseEntity or Edict it'll check the value stored in the pointer and if it's a NULL it'll error about it here. So currently there's no way to check if you can safely get the entity or edict from a param or not and it'll always error if it's NULL. In my test case DHookIsNullParam() returned false and skipped my if block, so it resulted in a "Exception reported: Trying to get value for null pointer".

Test code snippet:

	if(DHookIsNullParam(hParams, 5))
		return MRES_Ignored;
	
	int val = DHookGetParam(hParams, 5);

Error happens on the int val = DHookGetParam(hParams, 5); line.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions