From 27465cf2acc40599a83feaa100cdb19ca501d82c Mon Sep 17 00:00:00 2001 From: James Goodman Date: Wed, 22 Jan 2014 16:29:12 +1300 Subject: [PATCH] Fix exception when this.data() returns undefined --- javascript/display_logic.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/javascript/display_logic.js b/javascript/display_logic.js index 59cd027..5803836 100644 --- a/javascript/display_logic.js +++ b/javascript/display_logic.js @@ -96,7 +96,9 @@ }, getMasters: function() { - return this.data('display-logic-masters').split(","); + var masters = this.data('display-logic-masters'); + + return (masters) ? masters.split(",") : []; } }); @@ -222,4 +224,4 @@ }); //}) -})(jQuery); \ No newline at end of file +})(jQuery);