From 892eeea5ae2c7be313c718a88830ac9ec948a9ef Mon Sep 17 00:00:00 2001 From: Olivier Laurent Date: Wed, 14 Jan 2009 08:59:02 +0100 Subject: [PATCH] Fixed a potential IndexError if variable 'dir' equals '' bzr revid: olt@tinyerp.com-20090114075902-tz5sbtlkcsrg56qc --- bin/addons/__init__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bin/addons/__init__.py b/bin/addons/__init__.py index a75f30f1cf6..bf0dc39e279 100644 --- a/bin/addons/__init__.py +++ b/bin/addons/__init__.py @@ -154,8 +154,9 @@ def get_module_filetree(module, dir='.'): return False dir = os.path.normpath(dir) - if dir == '.': dir = '' - if dir.startswith('..') or dir[0] == '/': + if dir == '.': + dir = '' + if dir.startswith('..') or (dir and dir[0] == '/'): raise Exception('Cannot access file outside the module') if not os.path.isdir(path):