Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorTon Roosendaal <ton@blender.org>2007-03-26 17:02:43 +0400
committerTon Roosendaal <ton@blender.org>2007-03-26 17:02:43 +0400
commitd1315a342d7db1653a7fc3cecb646ab785e08f6e (patch)
treec071b9dfc999c24a373a9454fa05fc8a242e5a3a /source
parent31673f0a8c5b98b3a837d5003ca1275080354bee (diff)
Bugfix: function new_id() was allowed to be called with NULL.
Caused by Ken Hughes commit of 5 days ago Note; dup_id() will go away, is not according to Blender spec.
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenkernel/intern/library.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c
index d8fab3cf696..4468ec684c0 100644
--- a/source/blender/blenkernel/intern/library.c
+++ b/source/blender/blenkernel/intern/library.c
@@ -811,7 +811,7 @@ int dup_id(ListBase *lb, ID *id, const char *tname)
if( strlen(name) > 21 ) name[21]= 0;
}
- if(lb==0) lb= wich_libbase(G.main, GS(id->name));
+ if(lb==NULL) lb= wich_libbase(G.main, GS(id->name));
/* phase 1: id already exists? */
idtest= lb->first;
@@ -883,8 +883,11 @@ int new_id(ListBase *lb, ID *id, const char *tname)
/* only for local blocks: external en indirect blocks already have a unique ID */
/* return 1: created a new name */
{
- int result = dup_id( lb, id, tname );
-
+ int result;
+
+ if(lb==NULL) lb= wich_libbase(G.main, GS(id->name));
+
+ result = dup_id( lb, id, tname );
if( result )
sort_alpha_id(lb, id);