diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-04-29 20:14:51 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-04-29 20:14:51 +0300 |
commit | 0c512a6f951e36e29d2f6865cc975f7e40c4d31d (patch) | |
tree | f7c44bf73b6e2be40d62298b08af0ac4ada44240 /source/blender/windowmanager/intern | |
parent | 4218a94b1ed3fc2cdb3cd70206ff7a9604886c3a (diff) |
Fix missing NULL check when setting the tool
Diffstat (limited to 'source/blender/windowmanager/intern')
-rw-r--r-- | source/blender/windowmanager/intern/wm_toolsystem.c | 10 |
1 files changed, 6 insertions, 4 deletions
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); + } } } } |