ModelRelation/getOrFail: don't fail when 0 model where found
This commit is contained in:
parent
37ed42b37d
commit
fb1a09baf8
@ -39,7 +39,7 @@ export default abstract class ModelRelation<S extends Model, O extends Model, R
|
||||
}
|
||||
|
||||
public getOrFail(): R {
|
||||
if (!this.cachedModels) throw new Error('Models were not fetched');
|
||||
if (this.cachedModels === undefined) throw new Error('Models were not fetched');
|
||||
return this.cachedModels;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user