From 67f6b8599d3337abf326e1f0f22da7f2acb9a44a Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Sat, 29 Aug 2015 15:25:36 +0930 Subject: [PATCH] Allow string primitives to be added to ItemLists --- js/lib/utils/ItemList.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/js/lib/utils/ItemList.js b/js/lib/utils/ItemList.js index 215c1c765..6e631dcf6 100644 --- a/js/lib/utils/ItemList.js +++ b/js/lib/utils/ItemList.js @@ -50,6 +50,10 @@ export default class ItemList { for (const i in this) { if (this.hasOwnProperty(i) && this[i] instanceof Item) { + if (typeof this[i].content === 'string') { + this[i].content = new String(this[i].content); + } + this[i].content.itemName = i; items.push(this[i]); this[i].key = items.length;