Skip to content

Commit 84e5e6a

Browse files
yanasczdziraf
authored andcommitted
fix: tweak Resource.findOne to return null if no record is found
1 parent bd27164 commit 84e5e6a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/Resource.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ export class Resource extends BaseResource {
8585
[idProperty.path()]: convertParam(idProperty, this.model.fields, id),
8686
},
8787
});
88+
if (!result) return null;
8889

8990
return new BaseRecord(this.prepareReturnValues(result), this);
9091
}

0 commit comments

Comments
 (0)