From 0999a01b03d4ee727ff73661ec35c8c169926689 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dietrich?= Date: Mon, 14 Feb 2022 16:13:25 +0100 Subject: Fix T95320: CacheFile templates crash when used through Python The crash is caused as we did not check that the RNA pointer is null before trying to use it. This moves the existing checks from the modifier panels into the template functions so the logic is a bit centralized. --- source/blender/modifiers/intern/MOD_meshsequencecache.c | 16 ---------------- 1 file changed, 16 deletions(-) (limited to 'source/blender/modifiers/intern/MOD_meshsequencecache.c') diff --git a/source/blender/modifiers/intern/MOD_meshsequencecache.c b/source/blender/modifiers/intern/MOD_meshsequencecache.c index b5dd0566215..1d3699e41ec 100644 --- a/source/blender/modifiers/intern/MOD_meshsequencecache.c +++ b/source/blender/modifiers/intern/MOD_meshsequencecache.c @@ -343,10 +343,6 @@ static void velocity_panel_draw(const bContext *UNUSED(C), Panel *panel) return; } - if (RNA_pointer_is_null(&fileptr)) { - return; - } - uiLayoutSetPropSep(layout, true); uiTemplateCacheFileVelocity(layout, &fileptr); uiItemR(layout, ptr, "velocity_scale", 0, NULL, ICON_NONE); @@ -364,10 +360,6 @@ static void time_panel_draw(const bContext *UNUSED(C), Panel *panel) return; } - if (RNA_pointer_is_null(&fileptr)) { - return; - } - uiLayoutSetPropSep(layout, true); uiTemplateCacheFileTimeSettings(layout, &fileptr); } @@ -384,10 +376,6 @@ static void render_procedural_panel_draw(const bContext *C, Panel *panel) return; } - if (RNA_pointer_is_null(&fileptr)) { - return; - } - uiLayoutSetPropSep(layout, true); uiTemplateCacheFileProcedural(layout, C, &fileptr); } @@ -404,10 +392,6 @@ static void override_layers_panel_draw(const bContext *C, Panel *panel) return; } - if (RNA_pointer_is_null(&fileptr)) { - return; - } - uiLayoutSetPropSep(layout, true); uiTemplateCacheFileLayers(layout, C, &fileptr); } -- cgit v1.2.3