mirror of
https://github.com/flarum/core.git
synced 2025-07-23 09:41:26 +02:00
Prevent ItemList crash when item is a number
This commit is contained in:
@@ -50,9 +50,7 @@ export default class ItemList {
|
|||||||
|
|
||||||
for (const i in this) {
|
for (const i in this) {
|
||||||
if (this.hasOwnProperty(i) && this[i] instanceof Item) {
|
if (this.hasOwnProperty(i) && this[i] instanceof Item) {
|
||||||
if (typeof this[i].content === 'string') {
|
this[i].content = Object(this[i].content);
|
||||||
this[i].content = new String(this[i].content);
|
|
||||||
}
|
|
||||||
|
|
||||||
this[i].content.itemName = i;
|
this[i].content.itemName = i;
|
||||||
items.push(this[i]);
|
items.push(this[i]);
|
||||||
|
Reference in New Issue
Block a user