Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2011-12-12 07:25:10 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-12-12 07:25:10 +0400
commit4a364d23629c8dcc66f7a8478153cb4b86fa562f (patch)
treea42cc70e463380b67671231acbeec5adf41ebacb /source/blender/editors/interface/interface_ops.c
parent5600cf9dd92ebf7f256a5996db080c4721779b36 (diff)
fix for 2 crashes running operators in background mode.
Diffstat (limited to 'source/blender/editors/interface/interface_ops.c')
-rw-r--r--source/blender/editors/interface/interface_ops.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/source/blender/editors/interface/interface_ops.c b/source/blender/editors/interface/interface_ops.c
index 2a75c2a26c1..b50df29918d 100644
--- a/source/blender/editors/interface/interface_ops.c
+++ b/source/blender/editors/interface/interface_ops.c
@@ -458,11 +458,16 @@ static int reports_to_text_exec(bContext *C, wmOperator *UNUSED(op))
* - otherwise, up to info (which is what users normally see)
*/
str = BKE_reports_string(reports, (G.f & G_DEBUG)? RPT_DEBUG : RPT_INFO);
-
- write_text(txt, str);
- MEM_freeN(str);
-
- return OPERATOR_FINISHED;
+
+ if (str) {
+ write_text(txt, str);
+ MEM_freeN(str);
+
+ return OPERATOR_FINISHED;
+ }
+ else {
+ return OPERATOR_CANCELLED;
+ }
}
static void UI_OT_reports_to_textblock(wmOperatorType *ot)