From ff1ea600c98ba542c3b950fcfaf350626e078899 Mon Sep 17 00:00:00 2001 From: Philipp Oeser Date: Thu, 15 Aug 2019 11:39:45 +0200 Subject: Fix T68675: particle edit mode makes blender crash In rB9c010c44f420, DRW_mesh_batch_cache_create_requested was changed to take a scene (instead of toolsettings directly), but DRW_draw_depth_object is calling this with with NULL, just checking for this seems to fix... Reviewers: fclem Maniphest Tasks: T68675 Differential Revision: https://developer.blender.org/D5488 --- source/blender/draw/intern/draw_cache_impl_mesh.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source/blender/draw/intern/draw_cache_impl_mesh.c b/source/blender/draw/intern/draw_cache_impl_mesh.c index 8c89ac4703c..12c6a715685 100644 --- a/source/blender/draw/intern/draw_cache_impl_mesh.c +++ b/source/blender/draw/intern/draw_cache_impl_mesh.c @@ -969,7 +969,10 @@ void DRW_mesh_batch_cache_free_old(Mesh *me, int ctime) void DRW_mesh_batch_cache_create_requested( Object *ob, Mesh *me, const Scene *scene, const bool is_paint_mode, const bool use_hide) { - const ToolSettings *ts = scene->toolsettings; + const ToolSettings *ts = NULL; + if (scene) { + ts = scene->toolsettings; + } MeshBatchCache *cache = mesh_batch_cache_get(me); /* Early out */ -- cgit v1.2.3