From 97c78e25f00391e068b1247fa32b47fe2bf244e8 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 12 Sep 2011 13:59:23 +0000 Subject: [PATCH] fix for opencollada crash with r40164, missing NULL check. --- source/blender/collada/EffectExporter.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/source/blender/collada/EffectExporter.cpp b/source/blender/collada/EffectExporter.cpp index b4cc88ee3b8..6863e26a3ce 100644 --- a/source/blender/collada/EffectExporter.cpp +++ b/source/blender/collada/EffectExporter.cpp @@ -178,7 +178,11 @@ void EffectsExporter::operator()(Material *ma, Object *ob) // ambient /* ma->ambX is calculated only on render, so lets do it here manually and not rely on ma->ambX. */ - cot = getcol(this->scene->world->ambr*ma->amb, this->scene->world->ambg*ma->amb, this->scene->world->ambb*ma->amb, 1.0f); + if(this->scene->world) + cot = getcol(this->scene->world->ambr*ma->amb, this->scene->world->ambg*ma->amb, this->scene->world->ambb*ma->amb, 1.0f); + else + cot = getcol(ma->amb, ma->amb, ma->amb, 1.0f); + ep.setAmbient(cot, false , "ambient"); // reflective, reflectivity