diff options
Diffstat (limited to 'source/blender/editors/space_script/script_edit.c')
-rw-r--r-- | source/blender/editors/space_script/script_edit.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/source/blender/editors/space_script/script_edit.c b/source/blender/editors/space_script/script_edit.c index 50cfa2e71c7..13adf6bfc2d 100644 --- a/source/blender/editors/space_script/script_edit.c +++ b/source/blender/editors/space_script/script_edit.c @@ -47,12 +47,14 @@ static int run_pyfile_exec(bContext *C, wmOperator *op) { - char path[512]; + char path[FILE_MAX]; RNA_string_get(op->ptr, "filepath", path); #ifdef WITH_PYTHON if (BPY_run_filepath(C, path, op->reports)) { ARegion *region = CTX_wm_region(C); - ED_region_tag_redraw(region); + if (region != NULL) { + ED_region_tag_redraw(region); + } return OPERATOR_FINISHED; } #else @@ -70,7 +72,6 @@ void SCRIPT_OT_python_file_run(wmOperatorType *ot) /* api callbacks */ ot->exec = run_pyfile_exec; - ot->poll = ED_operator_areaactive; /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_INTERNAL; |