you should always use IsValid to check object references/pointers before using its data or functions. and if the reference is invalid, maybe that is a good time to try to set the reference.