javascript check if object is not null