fixed nullptr
This commit is contained in:
parent
da1f885e9a
commit
9dd5878f31
1 changed files with 1 additions and 1 deletions
|
@ -122,7 +122,7 @@ Color CloudShader::transparency(const Scene &scene, const Ray &ray, float maxLen
|
|||
cloudRay.primitive = nullptr;
|
||||
|
||||
// Get out of cloud primitive first
|
||||
if (!ray.primitive->intersect(cloudRay) || cloudRay.length == INFINITY || cloudRay.length <= 0)
|
||||
if (ray.primitive != nullptr && !ray.primitive->intersect(cloudRay) || cloudRay.length == INFINITY || cloudRay.length <= 0)
|
||||
{
|
||||
// Something went wrong
|
||||
return Color(1, 1, 1);
|
||||
|
|
Loading…
Reference in a new issue