added more nullchecks to raytracing functions (deal with it FC)