Fix T63115 crash upon switching to textured/rendered mode
authorClément Foucault <foucault.clem@gmail.com>
Sat, 30 Mar 2019 03:20:25 +0000 (04:20 +0100)
committerClément Foucault <foucault.clem@gmail.com>
Sat, 30 Mar 2019 03:20:35 +0000 (04:20 +0100)
source/blender/nodes/shader/nodes/node_shader_tex_coord.c

index dfd5a46..5a7a81f 100644 (file)
@@ -37,7 +37,10 @@ static bNodeSocketTemplate sh_node_tex_coord_out[] = {
 static int node_shader_gpu_tex_coord(GPUMaterial *mat, bNode *node, bNodeExecData *UNUSED(execdata), GPUNodeStack *in, GPUNodeStack *out)
 {
        Object *ob = (Object *)node->id;
-       invert_m4_m4(ob->imat, ob->obmat);
+
+       if (ob != NULL) {
+               invert_m4_m4(ob->imat, ob->obmat);
+       }
 
        GPUNodeLink *inv_obmat = (ob != NULL) ? GPU_uniform(&ob->imat[0][0]) : GPU_builtin(GPU_INVERSE_OBJECT_MATRIX);