add null check to tests