From 8a0098ec1f149dd15a266379f83dec0428fc4e30 Mon Sep 17 00:00:00 2001 From: j Date: Tue, 25 Sep 2018 10:34:35 +0200 Subject: [PATCH] don't output null, use empty string instead, fixes #3168 --- static/js/list.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/static/js/list.js b/static/js/list.js index 09dfca44d..1ad41d8bf 100644 --- a/static/js/list.js +++ b/static/js/list.js @@ -145,7 +145,7 @@ pandora.ui.list = function() { info.css({width: size * 0.75 + 'px'}); } } else { - info = data[sortKey]; + info = data[sortKey] || ''; } } size = size || 128; @@ -192,7 +192,9 @@ pandora.ui.list = function() { info = data['year'] || data['date'] || ''; } else { format = pandora.getSortKeyData(sortKey).format; - if (format) { + if (Ox.isUndefined(data[sortKey]) || Ox.isNull(data[sortKey])) { + info = ''; + } else if (format) { info = ( /^color/.test(format.type.toLowerCase()) ? Ox.Theme : Ox )['format' + Ox.toTitleCase(format.type)].apply( @@ -202,7 +204,7 @@ pandora.ui.list = function() { info.css({width: size * 0.75 + 'px'}); } } else { - info = data[sortKey]; + info = data[sortKey] || ''; } } return { @@ -279,7 +281,9 @@ pandora.ui.list = function() { info = data['year'] || data['date'] || ''; } else { format = pandora.getSortKeyData(sortKey).format; - if (format) { + if (Ox.isUndefined(data[sortKey]) || Ox.isNull(data[sortKey])) { + info = ''; + } else if (format) { info = ( /^color/.test(format.type.toLowerCase()) ? Ox.Theme : Ox )['format' + Ox.toTitleCase(format.type)].apply( @@ -289,7 +293,7 @@ pandora.ui.list = function() { info.css({width: size * 0.75 + 'px'}); } } else { - info = data[sortKey]; + info = data[sortKey] || ''; } } return {