From aaa8f4f1ca2b58be98880213116abc77e077a7ee Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Tue, 3 Jan 2012 14:33:21 +0530 Subject: [PATCH] empy array values should be empty arrays --- static/js/pandora/infoView.js | 4 ++-- static/js/pandora/infoView.padma.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/static/js/pandora/infoView.js b/static/js/pandora/infoView.js index 5b60d539..881d5ba7 100644 --- a/static/js/pandora/infoView.js +++ b/static/js/pandora/infoView.js @@ -497,8 +497,8 @@ pandora.ui.infoView = function(data) { var edit = {id: data.id}; if (key == 'title') { Ox.extend(edit, parseTitle(value)); - } else if (key == 'director' || key == 'country') { - edit[key] = value.split(', '); + } else if(['director', 'country'].indexOf(key) > -1) { + edit[key] = value ? value.split(', ') : []; } else { edit[key] = value; } diff --git a/static/js/pandora/infoView.padma.js b/static/js/pandora/infoView.padma.js index c7c1a34d..58dea2d1 100644 --- a/static/js/pandora/infoView.padma.js +++ b/static/js/pandora/infoView.padma.js @@ -389,7 +389,7 @@ pandora.ui.infoView = function(data) { var edit = {id: data.id}; if (key == 'title') { Ox.extend(edit, parseTitle(value)); - } else if(['director', 'country', 'language', 'category'].indexOf(key) >= 0) { + } else if(['director', 'country', 'language', 'category'].indexOf(key) > -1) { edit[key] = value ? value.split(', ') : []; } else { edit[key] = value;