[Bf-blender-cvs] [2008c24123d] master: Cleanup: add NULL check for filename argument which could be NULL

Campbell Barton noreply at git.blender.org
Mon Jan 4 07:41:52 CET 2021


Commit: 2008c24123d261c473d65291a2ed5351e297525a
Author: Campbell Barton
Date:   Mon Jan 4 15:35:17 2021 +1100
Branches: master
https://developer.blender.org/rB2008c24123d261c473d65291a2ed5351e297525a

Cleanup: add NULL check for filename argument which could be NULL

While it's never NULL at the moment, checks elsewhere in this function
support passing in a NULL filename, so keep this working as intended
in case RNAProcessItem.filename is NULL in the future.

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

M	source/blender/makesrna/intern/makesrna.c

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

diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c
index c2c95c59002..e9e00ff6f71 100644
--- a/source/blender/makesrna/intern/makesrna.c
+++ b/source/blender/makesrna/intern/makesrna.c
@@ -4436,7 +4436,7 @@ static void rna_generate(BlenderRNA *brna, FILE *f, const char *filename, const
     }
   }
 
-  if (STREQ(filename, "rna_ID.c")) {
+  if (filename && STREQ(filename, "rna_ID.c")) {
     /* this is ugly, but we cannot have c files compiled for both
      * makesrna and blender with some build systems at the moment */
     fprintf(f, "#include \"rna_define.c\"\n\n");



More information about the Bf-blender-cvs mailing list