mirror of
https://github.com/flarum/framework.git
synced 2025-01-28 03:35:49 +08:00
Pass null/falsy values through Model.getIdentifier (#3131)
* Pass null/falsy values through Model.getIdentifier * Add explicit if-return
This commit is contained in:
parent
e8ffdead39
commit
ce9f8f9880
|
@ -313,6 +313,8 @@ export default class Model {
|
||||||
* @protected
|
* @protected
|
||||||
*/
|
*/
|
||||||
static getIdentifier(model) {
|
static getIdentifier(model) {
|
||||||
|
if (!model) return model;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
type: model.data.type,
|
type: model.data.type,
|
||||||
id: model.data.id,
|
id: model.data.id,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user