CSS: Fixed crashing bug by adding null check