Skip to content

Commit ded7946

Browse files
KurganovStephenSorriaux
authored andcommitted
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' ```
1 parent ab0cd00 commit ded7946

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

kazoo/recipe/lock.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,8 @@ def contenders(self):
353353
for child in children:
354354
try:
355355
data, stat = self.client.get(self.path + "/" + child)
356-
contenders.append(data.decode('utf-8'))
356+
if data is not None:
357+
contenders.append(data.decode('utf-8'))
357358
except NoNodeError: # pragma: nocover
358359
pass
359360
return contenders

0 commit comments

Comments
 (0)