From 0d699fb46a4c230c97440036b762e068c60afd05 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 10 Jun 2013 02:05:38 +0000 Subject: minor edit to previous commit, only show option to reload the file if its been saved. --- release/scripts/startup/bl_ui/space_info.py | 8 +++++--- source/blender/windowmanager/intern/wm_files.c | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/release/scripts/startup/bl_ui/space_info.py b/release/scripts/startup/bl_ui/space_info.py index 1885f115aa8..7487aaf420d 100644 --- a/release/scripts/startup/bl_ui/space_info.py +++ b/release/scripts/startup/bl_ui/space_info.py @@ -68,9 +68,11 @@ class INFO_HT_header(Header): if bpy.app.autoexec_fail is True and bpy.app.autoexec_fail_quiet is False: layout.operator_context = 'EXEC_DEFAULT' row.label("Script failed to auto-run", icon='ERROR') - props = row.operator("wm.open_mainfile", icon='SCREEN_BACK', text="Reload Trusted") - props.filepath = bpy.data.filepath - props.use_scripts = True + if bpy.data.is_saved: + props = row.operator("wm.open_mainfile", icon='SCREEN_BACK', text="Reload Trusted") + props.filepath = bpy.data.filepath + props.use_scripts = True + row.operator("script.autoexec_warn_clear", icon='CANCEL') row.label("Skipping: (%s)" % bpy.app.autoexec_fail_message) return diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c index f9e93118033..406dbd8ca96 100644 --- a/source/blender/windowmanager/intern/wm_files.c +++ b/source/blender/windowmanager/intern/wm_files.c @@ -327,7 +327,7 @@ static int wm_read_exotic(Scene *UNUSED(scene), const char *name) /* make sure we're not trying to read a directory.... */ len = strlen(name); - if (ELEM(name[len - 1], '/', '\\')) { + if (len > 0 && ELEM(name[len - 1], '/', '\\')) { retval = BKE_READ_EXOTIC_FAIL_PATH; } else { -- cgit v1.2.3