From fd318ef706f174e13395ef76014b1ad8faf020c8 Mon Sep 17 00:00:00 2001 From: j Date: Thu, 16 Sep 2021 18:49:38 +0200 Subject: [PATCH] fall back to empty string --- pandora/item/models.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pandora/item/models.py b/pandora/item/models.py index e09fddd9..99f062b9 100644 --- a/pandora/item/models.py +++ b/pandora/item/models.py @@ -1019,10 +1019,14 @@ class Item(models.Model): set_value(s, name, value) elif sort_type == 'person': value = sortNames(self.get(source, [])) + if value is None: + value = '' value = utils.sort_string(value)[:955] set_value(s, name, value) elif sort_type == 'string': value = self.get(source, '') + if value is None: + value = '' if isinstance(value, list): value = ','.join([str(v) for v in value]) value = utils.sort_string(value)[:955]