You should compare if one of the start is not null, same for end...