From 9dd5878f316733c2c98f7e8884aac50eaf410ac6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?arvid=20schr=C3=B6der?= Date: Wed, 25 Jan 2023 00:07:44 +0100 Subject: [PATCH] fixed nullptr --- shader/cloudshader.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shader/cloudshader.cpp b/shader/cloudshader.cpp index 2f0e120..11a8160 100644 --- a/shader/cloudshader.cpp +++ b/shader/cloudshader.cpp @@ -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);