From 02836f1684c5358047533a9d9332fa4e7369f23d Mon Sep 17 00:00:00 2001 From: Bertrand Chenal Date: Wed, 28 May 2008 18:22:18 +0200 Subject: [PATCH] Fix: webdav: don't crash if an attachement is put at a wrong place. --- trytond/webdav/webdav.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/trytond/webdav/webdav.py b/trytond/webdav/webdav.py index 82cec19ed1..df03657352 100644 --- a/trytond/webdav/webdav.py +++ b/trytond/webdav/webdav.py @@ -85,7 +85,10 @@ class Directory(OSV): object_name = None object_id = False else: - object_id = int(name.rsplit('-', 1)[1].strip()) + splitted_name = name.rsplit('-', 1) + if len(splitted_name) != 2: + return object_name, 0 + object_id = int(splitted_name[1].strip()) if uri: if '/' in uri: return None, 0