From 23143185eaec7edb5b934c951ee60bcb18b952d8 Mon Sep 17 00:00:00 2001 From: j Date: Tue, 20 Sep 2016 02:55:06 +0200 Subject: [PATCH] item can be unavailable --- pandora/itemlist/models.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pandora/itemlist/models.py b/pandora/itemlist/models.py index 3adcf497f..00e54087a 100644 --- a/pandora/itemlist/models.py +++ b/pandora/itemlist/models.py @@ -247,9 +247,10 @@ class List(models.Model): from item.models import Item qs = Item.objects.filter(public_id=i['item']) if qs.count() > 0: - frame = qs[0].frame(i['position']) - if frame: - frames.append(frame) + if i.get('position'): + frame = qs[0].frame(i['position']) + if frame: + frames.append(frame) self.icon.name = self.path('icon.jpg') icon = self.icon.path if frames: