is there an instruction to let the engine test if
a pointer is valid?

The pointer is known, the engine knows its objects internally.
So it should be a simple step to confirm the validity
of the object by iterating though the list of objects.