minor edit to previous commit, only show option to reload the file if its been saved.
authorCampbell Barton <ideasman42@gmail.com>
Mon, 10 Jun 2013 02:05:38 +0000 (02:05 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 10 Jun 2013 02:05:38 +0000 (02:05 +0000)
release/scripts/startup/bl_ui/space_info.py
source/blender/windowmanager/intern/wm_files.c

index 1885f115aa83ea87a0c13f10b63a0583b93f4b9d..7487aaf420d4ff4540909f57b26518a3480ef492 100644 (file)
@@ -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
index f9e931180338a476e1d4591f4bf4cd07b488f458..406dbd8ca9671311dca902dd04ba5ea8432cbc26 100644 (file)
@@ -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 {