File > Open recent raised an error when there was no .Blog file. Now it prints an...
authorThomas Dinges <blender@dingto.org>
Mon, 15 Feb 2010 01:42:51 +0000 (01:42 +0000)
committerThomas Dinges <blender@dingto.org>
Mon, 15 Feb 2010 01:42:51 +0000 (01:42 +0000)
release/scripts/ui/space_info.py

index 24b080d80df3c8df450c752aafa0bfbcf2e49f18..f1f3201770c8ee38e31cc7d67d60dc84a51e5900 100644 (file)
@@ -123,11 +123,14 @@ class INFO_MT_file_open_recent(bpy.types.Menu):
         import os
         layout = self.layout
         layout.operator_context = 'EXEC_AREA'
-        file = open(os.path.join(bpy.app.home, ".Blog"), "rU")
-        for line in file:
-            line = line.rstrip()
-            layout.operator("wm.open_mainfile", text=line, icon='FILE_BLEND').path = line
-        file.close()
+        try:
+            file = open(os.path.join(bpy.app.home, ".Blog"), "rU")
+            for line in file:
+                line = line.rstrip()
+                layout.operator("wm.open_mainfile", text=line, icon='FILE_BLEND').path = line
+            file.close()
+        except:
+            layout.label(text='No recent files')
 
 
 class INFO_MT_file_import(bpy.types.Menu):