Add null check to category