[Bf-blender-cvs] [b608133075b] blender2.8: Fix crash if no tool is set

Campbell Barton noreply at git.blender.org
Sat Jun 2 13:10:41 CEST 2018


Commit: b608133075b6362aa067e32538fb5a5c7a3e5c30
Author: Campbell Barton
Date:   Sat Jun 2 12:02:55 2018 +0200
Branches: blender2.8
https://developer.blender.org/rBb608133075b6362aa067e32538fb5a5c7a3e5c30

Fix crash if no tool is set

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

M	source/blender/windowmanager/intern/wm_toolsystem.c

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

diff --git a/source/blender/windowmanager/intern/wm_toolsystem.c b/source/blender/windowmanager/intern/wm_toolsystem.c
index 508713c9096..cee5079a02f 100644
--- a/source/blender/windowmanager/intern/wm_toolsystem.c
+++ b/source/blender/windowmanager/intern/wm_toolsystem.c
@@ -541,7 +541,7 @@ void WM_toolsystem_update_from_context_view3d(bContext *C)
 bool WM_toolsystem_active_tool_is_brush(const bContext *C)
 {
 	bToolRef_Runtime *tref_rt = WM_toolsystem_runtime_from_context((bContext *)C);
-	return tref_rt->data_block[0] != '\0';
+	return tref_rt && (tref_rt->data_block[0] != '\0');
 }
 
 /* Follow wmMsgNotifyFn spec */



More information about the Bf-blender-cvs mailing list