From 9f7a4125118c19e39dd80828db041283599d2189 Mon Sep 17 00:00:00 2001 From: Thomas Dinges Date: Mon, 15 Feb 2010 01:42:51 +0000 Subject: [PATCH] File > Open recent raised an error when there was no .Blog file. Now it prints an info. --- release/scripts/ui/space_info.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/release/scripts/ui/space_info.py b/release/scripts/ui/space_info.py index 24b080d80df..f1f3201770c 100644 --- a/release/scripts/ui/space_info.py +++ b/release/scripts/ui/space_info.py @@ -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):