Skip to content

Commit

Permalink
fix(recipe): crash if None in znode (#569)
Browse files Browse the repository at this point in the history
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'
```
  • Loading branch information
Kurganov authored and StephenSorriaux committed Oct 1, 2019
1 parent ab0cd00 commit ded7946
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion kazoo/recipe/lock.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,8 @@ def contenders(self):
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
Expand Down

0 comments on commit ded7946

Please sign in to comment.