From 84e5e6a83280f20252129f1446e8f27ed65a67f3 Mon Sep 17 00:00:00 2001 From: yanas Date: Tue, 11 Jul 2023 14:09:33 +0200 Subject: [PATCH] fix: tweak Resource.findOne to return null if no record is found --- src/Resource.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Resource.ts b/src/Resource.ts index 3e6c92e..94470e1 100644 --- a/src/Resource.ts +++ b/src/Resource.ts @@ -85,6 +85,7 @@ export class Resource extends BaseResource { [idProperty.path()]: convertParam(idProperty, this.model.fields, id), }, }); + if (!result) return null; return new BaseRecord(this.prepareReturnValues(result), this); }