Prevent ItemList crash when item is a number

This commit is contained in:
Toby Zerner 2015-09-04 12:17:01 +09:30
parent 601f7adb0f
commit 39c3b468dc

View File

@ -50,9 +50,7 @@ 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 = Object(this[i].content);
this[i].content.itemName = i;
items.push(this[i]);