Fixed the forgotten null check error.