1
0
mirror of https://github.com/flarum/core.git synced 2025-06-01 12:05:54 +02:00

Prevent ItemList crash when item is a number

This commit is contained in:
Toby Zerner 2015-09-04 12:17:01 +09:30
parent 7cce5b02ba
commit 44f460cb11

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]);