Skip to content

Commit 11e94d1

Browse files
committed
fix: handle null on item
1 parent 4286415 commit 11e94d1

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@adityadarma/adonis-service-repository",
33
"description": "",
4-
"version": "2.1.1",
4+
"version": "3.0.1",
55
"engines": {
66
"node": ">=20.6.0"
77
},

src/core/base_resource.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export abstract class BaseResource<T extends LucidRow['$attributes']> {
1313

1414
static async item<K extends LucidRow['$attributes'], R extends BaseResource<K>>(
1515
this: ResourceConstructor<K, R>,
16-
resource: K
16+
resource: K | null
1717
): Promise<Awaited<ReturnType<R['toObject']>> | null> {
1818
if (!resource) {
1919
return null

0 commit comments

Comments
 (0)