[Bf-blender-cvs] [0c512a6f951] blender2.8: Fix missing NULL check when setting the tool

Campbell Barton noreply at git.blender.org
Sun Apr 29 19:15:30 CEST 2018


Commit: 0c512a6f951e36e29d2f6865cc975f7e40c4d31d
Author: Campbell Barton
Date:   Sun Apr 29 19:14:51 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB0c512a6f951e36e29d2f6865cc975f7e40c4d31d

Fix missing NULL check when setting the tool

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

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 06380d6eb8e..bf9583e3713 100644
--- a/source/blender/windowmanager/intern/wm_toolsystem.c
+++ b/source/blender/windowmanager/intern/wm_toolsystem.c
@@ -81,10 +81,12 @@ void WM_toolsystem_link(bContext *C, WorkSpace *workspace)
 	}
 	if (workspace->tool.data_block[0]) {
 		/* Currently only brush data-blocks supported. */
-		Paint *p = BKE_paint_get_active_from_context(C);
-		struct Brush *brush = (struct Brush *)BKE_libblock_find_name(ID_BR, workspace->tool.data_block);
-		if (brush) {
-			BKE_paint_brush_set(p, brush);
+		Paint *paint = BKE_paint_get_active_from_context(C);
+		if (paint) {
+			struct Brush *brush = (struct Brush *)BKE_libblock_find_name(ID_BR, workspace->tool.data_block);
+			if (brush) {
+				BKE_paint_brush_set(paint, brush);
+			}
 		}
 	}
 }



More information about the Bf-blender-cvs mailing list