check graph for null