[Bf-blender-cvs] [469398155d4] soc-2020-io-performance: Null check: no image is present in the texture node

Ankit Meel noreply at git.blender.org
Mon Jun 29 17:11:58 CEST 2020


Commit: 469398155d4776f1fd2925f87eaa4b6eb1db0929
Author: Ankit Meel
Date:   Mon Jun 29 20:41:50 2020 +0530
Branches: soc-2020-io-performance
https://developer.blender.org/rB469398155d4776f1fd2925f87eaa4b6eb1db0929

Null check: no image is present in the texture node

===================================================================

M	source/blender/io/wavefront_obj/intern/wavefront_obj_exporter_mtl.cc

===================================================================

diff --git a/source/blender/io/wavefront_obj/intern/wavefront_obj_exporter_mtl.cc b/source/blender/io/wavefront_obj/intern/wavefront_obj_exporter_mtl.cc
index 228401c9db7..0e2152cb3ec 100644
--- a/source/blender/io/wavefront_obj/intern/wavefront_obj_exporter_mtl.cc
+++ b/source/blender/io/wavefront_obj/intern/wavefront_obj_exporter_mtl.cc
@@ -45,7 +45,7 @@ void MTLWriter::init_bsdf_node(const char *object_name)
 {
   if (_export_mtl->use_nodes == false) {
     fprintf(
-        stderr, "No Principled-BSDF node found in the material Node tree of: %s.\n", object_name);
+        stderr, "No Principled-BSDF node found in the material node tree of: %s.\n", object_name);
     _bsdf_node = nullptr;
     return;
   }
@@ -57,7 +57,7 @@ void MTLWriter::init_bsdf_node(const char *object_name)
     }
   }
   fprintf(
-      stderr, "No Principled-BSDF node found in the material Node tree of: %s.\n", object_name);
+      stderr, "No Principled-BSDF node found in the material node tree of: %s.\n", object_name);
   _bsdf_node = nullptr;
 }
 
@@ -145,7 +145,9 @@ const char *MTLWriter::get_image_filepath(const bNode *tex_node)
 {
   if (tex_node) {
     Image *tex_image = (Image *)tex_node->id;
-    return tex_image->filepath;
+    if (tex_image) {
+      return tex_image->filepath;
+    }
   }
   return nullptr;
 }



More information about the Bf-blender-cvs mailing list