mirror of
https://github.com/flarum/core.git
synced 2025-08-03 15:07:53 +02:00
Make sure this.data.attributes
is initialized.
`Object.assign` is not type-safe, and does ensure that the property being assigned to is not undefined.
This commit is contained in:
@@ -110,6 +110,7 @@ export default abstract class Model {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ('attributes' in data) {
|
if ('attributes' in data) {
|
||||||
|
this.data.attributes ||= {};
|
||||||
Object.assign(this.data.attributes, data.attributes);
|
Object.assign(this.data.attributes, data.attributes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user