fix null dereference bug in false case