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
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2009-10-19 23:17:05 +0400
committerCampbell Barton <ideasman42@gmail.com>2009-10-19 23:17:05 +0400
commit0ce295064907b42e3f3140fc498b78c71304e03f (patch)
treea7e36e91dc9ce4de3bd3a7fafff9aeaea6b386bd /source/blender/editors/space_buttons
parent631fbf88e8df14924bc72e5f508c9d9ed403a536 (diff)
fix for crashing when unlinking a world from a scene
Diffstat (limited to 'source/blender/editors/space_buttons')
-rw-r--r--source/blender/editors/space_buttons/buttons_context.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/editors/space_buttons/buttons_context.c b/source/blender/editors/space_buttons/buttons_context.c
index bc0cc536857..d7375ee4e55 100644
--- a/source/blender/editors/space_buttons/buttons_context.c
+++ b/source/blender/editors/space_buttons/buttons_context.c
@@ -114,6 +114,8 @@ static int buttons_context_path_scene(ButsContextPath *path)
return RNA_struct_is_a(ptr->type, &RNA_Scene);
}
+/* note: this function can return 1 without adding a world to the path
+ * so the buttons stay visible, but be sure to check the ID type if a ID_WO */
static int buttons_context_path_world(ButsContextPath *path)
{
Scene *scene;
@@ -372,7 +374,7 @@ static int buttons_context_path_texture(const bContext *C, ButsContextPath *path
else if((path->flag & SB_WORLD_TEX) && buttons_context_path_world(path)) {
wo= path->ptr[path->len-1].data;
- if(wo) {
+ if(wo && GS(wo->id.name)==ID_WO) {
tex= give_current_world_texture(wo);
RNA_id_pointer_create(&tex->id, &path->ptr[path->len]);