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):