From dd86ae6e3be80131e6975aa54353e5e7454bd5b2 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 2 Feb 2012 05:55:01 +0000 Subject: fix [#28296] File selector crash when with filepath property disable browsing a file property within the file selector to avoid a crash. --- source/blender/editors/space_buttons/buttons_ops.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source/blender/editors/space_buttons') diff --git a/source/blender/editors/space_buttons/buttons_ops.c b/source/blender/editors/space_buttons/buttons_ops.c index b1a25d093d2..26516bcda99 100644 --- a/source/blender/editors/space_buttons/buttons_ops.c +++ b/source/blender/editors/space_buttons/buttons_ops.c @@ -43,6 +43,7 @@ #include "BKE_context.h" #include "BKE_global.h" #include "BKE_main.h" +#include "BKE_report.h" #include "WM_api.h" #include "WM_types.h" @@ -160,6 +161,11 @@ static int file_browse_invoke(bContext *C, wmOperator *op, wmEvent *event) FileBrowseOp *fbo; char *str; + if (CTX_wm_space_file(C)) { + BKE_report(op->reports, RPT_ERROR, "Can't activate a file selector, one already open"); + return OPERATOR_CANCELLED; + } + uiFileBrowseContextProperty(C, &ptr, &prop); if(!prop) -- cgit v1.2.3