don't fail on undefined item key

This commit is contained in:
j 2019-01-02 16:33:45 +01:00
parent 4e0c73c2fa
commit 27c7386775

View file

@ -162,16 +162,14 @@ pandora.ui.metadataDialog = function(data) {
} }
function formatValue(key, value) { function formatValue(key, value) {
var item = getItemKey(key)
return !value ? '' return !value ? ''
: key == 'alternativeTitles' ? value.map(function(v) { : key == 'alternativeTitles' ? value.map(function(v) {
return v[0]; return v[0];
}).join('; ') }).join('; ')
: key == 'runtime' ? Math.round(value / 60) + ' min' : key == 'runtime' ? Math.round(value / 60) + ' min'
: key == 'productionCompany' ? value.join('; ') : key == 'productionCompany' ? value.join('; ')
: Ox.isArray( : item && Ox.isArray(item.type) ? value.join(', ') : value;
getItemKey(key).type
) ? value.join(', ')
: value;
} }
function getFormWidth() { function getFormWidth() {