fix: don't patch set data with undefined (#6694)

This commit is contained in:
Rodry
2021-10-03 13:59:52 +01:00
committed by GitHub
parent 8b4456e0aa
commit 9eb9591473
33 changed files with 1211 additions and 795 deletions

View File

@@ -23,23 +23,35 @@ class Application extends Base {
*/
this.id = data.id;
/**
* The name of the application
* @type {?string}
*/
this.name = data.name ?? this.name ?? null;
if ('name' in data) {
/**
* The name of the application
* @type {?string}
*/
this.name = data.name;
} else {
this.name ??= null;
}
/**
* The application's description
* @type {?string}
*/
this.description = data.description ?? this.description ?? null;
if ('description' in data) {
/**
* The application's description
* @type {?string}
*/
this.description = data.description;
} else {
this.description ??= null;
}
/**
* The application's icon hash
* @type {?string}
*/
this.icon = data.icon ?? this.icon ?? null;
if ('icon' in data) {
/**
* The application's icon hash
* @type {?string}
*/
this.icon = data.icon;
} else {
this.icon ??= null;
}
}
/**