From 02e0c6f42e76e2cd5d086bde336789991434eba5 Mon Sep 17 00:00:00 2001 From: Julian Eisel Date: Thu, 5 Aug 2021 12:10:49 +0200 Subject: Fix T90430: Crash when dragging material Was trying to get asset information even when there was none, i.e. when the material wasn't an asset or not dragged from the Asset Browser. --- source/blender/windowmanager/intern/wm_dragdrop.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source/blender/windowmanager/intern') diff --git a/source/blender/windowmanager/intern/wm_dragdrop.c b/source/blender/windowmanager/intern/wm_dragdrop.c index dcbb502117e..76bb93b681c 100644 --- a/source/blender/windowmanager/intern/wm_dragdrop.c +++ b/source/blender/windowmanager/intern/wm_dragdrop.c @@ -469,7 +469,7 @@ static void wm_drop_operator_draw(const char *name, int x, int y) UI_fontstyle_draw_simple_backdrop(fstyle, x, y, name, col_fg, col_bg); } -static const char *wm_drag_name(wmDrag *drag) +const char *WM_drag_get_item_name(wmDrag *drag) { switch (drag->type) { case WM_DRAG_ID: { @@ -583,11 +583,11 @@ void wm_drags_draw(bContext *C, wmWindow *win, rcti *rect) } if (rect) { - int w = UI_fontstyle_string_width(fstyle, wm_drag_name(drag)); + int w = UI_fontstyle_string_width(fstyle, WM_drag_get_item_name(drag)); drag_rect_minmax(rect, x, y, x + w, y + iconsize); } else { - UI_fontstyle_draw_simple(fstyle, x, y, wm_drag_name(drag), text_col); + UI_fontstyle_draw_simple(fstyle, x, y, WM_drag_get_item_name(drag), text_col); } /* operator name with roundbox */ @@ -614,7 +614,7 @@ void wm_drags_draw(bContext *C, wmWindow *win, rcti *rect) } if (rect) { - int w = UI_fontstyle_string_width(fstyle, wm_drag_name(drag)); + int w = UI_fontstyle_string_width(fstyle, WM_drag_get_item_name(drag)); drag_rect_minmax(rect, x, y, x + w, y + iconsize); } else { -- cgit v1.2.3