mirror of
https://github.com/flarum/framework.git
synced 2024-11-25 09:41:49 +08: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:
parent
dc48e2327b
commit
364575b3f0
|
@ -110,6 +110,7 @@ export default abstract class Model {
|
|||
}
|
||||
|
||||
if ('attributes' in data) {
|
||||
this.data.attributes ||= {};
|
||||
Object.assign(this.data.attributes, data.attributes);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user