diff --git a/js/personalize.js b/js/personalize.js
index 258ca0b..855c538 100644
--- a/js/personalize.js
+++ b/js/personalize.js
@@ -189,14 +189,15 @@
       }
       var $option_source = $('script[type="text/template"]', $option_set);
       var element = $option_source.get(0);
-      var json = element.innerText;
-      if (typeof preview === 'undefined') { preview = false; };
-      if (json === undefined || json.length == 0) {
-        json = element.text;
+      if (element !== undefined) { 
+        var json = element.innerText;
+        if (typeof preview === 'undefined') { preview = false; };
+        if (json === undefined || json.length == 0) {
+          json = element.text;
+        }
+        var choices = jQuery.parseJSON(json);
+        var winner = '';
       }
-      var choices = jQuery.parseJSON(json);
-      var winner = '';
-
       if (choices == null || choices === false || !choices.hasOwnProperty(choice_name)) {
         // Invalid JSON in the template.  Just show the noscript option.
         winner = $(element).prev('noscript').html();
