diff --git a/src/ember-app.js b/src/ember-app.js
index ea5c636..0ec4327 100644
--- a/src/ember-app.js
+++ b/src/ember-app.js
@@ -422,6 +422,8 @@ function createShoebox(doc, fastbootInfo) {
let value = shoebox[key];
let textValue = JSON.stringify(value);
+ if (textValue === undefined) { continue; }
+
textValue = escapeJSONString(textValue);
let scriptText = doc.createRawHTMLSection(textValue);
diff --git a/test/fastboot-shoebox-test.js b/test/fastboot-shoebox-test.js
index 0783844..c7e26cb 100644
--- a/test/fastboot-shoebox-test.js
+++ b/test/fastboot-shoebox-test.js
@@ -23,6 +23,9 @@ describe("FastBootShoebox", function() {
expect(html).to.include('');
expect(html).to.include('');
+
+ // ignores undefined
+ expect(html).to.not.include('shoebox-key6');
});
});
@@ -43,6 +46,9 @@ describe("FastBootShoebox", function() {
expect(html).to.include('');
expect(html).to.include('');
+
+ // ignores undefined
+ expect(html).to.not.include('shoebox-key6');
});
});
@@ -63,6 +69,9 @@ describe("FastBootShoebox", function() {
expect(html).to.not.include('');
expect(html).to.not.include('');
+
+ // ignores undefined
+ expect(html).to.not.include('shoebox-key6');
});
});
});
diff --git a/test/fixtures/shoebox/fastboot/fastboot-test.js b/test/fixtures/shoebox/fastboot/fastboot-test.js
index d7a497e..17a02ff 100644
--- a/test/fixtures/shoebox/fastboot/fastboot-test.js
+++ b/test/fixtures/shoebox/fastboot/fastboot-test.js
@@ -300,6 +300,7 @@ define('fastboot-test/routes/application', ['exports', 'ember'], function (expor
shoebox.put('key3', { htmlSpecialCase: 'R&B > Jazz' });
shoebox.put('key4', { nastyScriptCase: "" });
shoebox.put('key5', { otherUnicodeChars: '&&>><<\u2028\u2028\u2029\u2029' });
+ shoebox.put('key6', undefined);
}
}
});