Added null check that ended up breaking tests.