mediastate can be undefined

This commit is contained in:
j 2016-02-18 13:45:13 +05:30
parent 030563c933
commit 22099d4b9a

View file

@ -141,7 +141,7 @@ def edit(data):
edited = []
for id in ids:
item = models.Item.get(id)
if item and item.json()['mediastate'] == 'available':
if item and item.json().get('mediastate') == 'available':
item.edit(data)
response = item.json()
edited.append(id)