Custom class test if null fails

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By nonfinity

This error comes up only occasionally. But I make 2 separate checks to see if current_ecoNode is null before working on it and somehow it’s still gets through when it’s null. Am I missing something?

current_ecoNode variable type is a custom class that extends GraphNode

Why is this code throwing errors?

:bust_in_silhouette: Reply From: Jummit

It could be that current_ecoNode is being freed. Try using is_instance_valid instead of != null.