From 7123498997006e374beb32f2245ba99ebb430cf5 Mon Sep 17 00:00:00 2001 From: inso <insomniak.fr@gmaiL.com> Date: Sun, 22 Oct 2017 15:45:41 +0200 Subject: [PATCH] Fix bug with empty endpoint (#744) --- src/sakia/data/entities/node.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/sakia/data/entities/node.py b/src/sakia/data/entities/node.py index 6c7bb24c..e1e560d5 100644 --- a/src/sakia/data/entities/node.py +++ b/src/sakia/data/entities/node.py @@ -10,11 +10,14 @@ def _tuple_of_endpoints(value): l = [endpoint(e) for e in value] return tuple(l) elif isinstance(value, str): - list_of_str = value.split('\n') - conv = [] - for s in list_of_str: - conv.append(endpoint(s)) - return conv + if value: + list_of_str = value.split('\n') + conv = [] + for s in list_of_str: + conv.append(endpoint(s)) + return conv + else: + return [] else: raise TypeError("Can't convert {0} to list of endpoints".format(value)) -- GitLab