summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKurganov <kurganov@gmail.com>2019-10-01 22:39:09 +0300
committerStephen SORRIAUX <stephen.sorriaux@gmail.com>2019-10-01 21:39:09 +0200
commitded79467a8254e43841dfeb69f7c3baa1980232c (patch)
tree6473637941e8bca97920d08dd0586032dc54ddc9
parentab0cd00c12624b07dcc3b2d62aa96f8f1e658f65 (diff)
downloadkazoo-ded79467a8254e43841dfeb69f7c3baa1980232c.tar.gz
fix(recipe): crash if None in znode (#569)
Avoid ``` File "/home/tests/kazoo/recipe/lock.py", line 341, in contenders contenders.append(data.decode('utf-8')) AttributeError: 'NoneType' object has no attribute 'decode' ```
-rw-r--r--kazoo/recipe/lock.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/kazoo/recipe/lock.py b/kazoo/recipe/lock.py
index 6a50cfb..9bd5dc0 100644
--- a/kazoo/recipe/lock.py
+++ b/kazoo/recipe/lock.py
@@ -353,7 +353,8 @@ class Lock(object):
for child in children:
try:
data, stat = self.client.get(self.path + "/" + child)
- contenders.append(data.decode('utf-8'))
+ if data is not None:
+ contenders.append(data.decode('utf-8'))
except NoNodeError: # pragma: nocover
pass
return contenders