Skip to content

Commit 5bddf3a

Browse files
committed
fix: make getRecordByPrimaryKey return null, instead of throwing an error
1 parent 296eed1 commit 5bddf3a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

adminforth/dataConnectors/baseConnector.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -510,6 +510,9 @@ export default class AdminForthBaseConnector implements IAdminForthDataSourceCon
510510
getRecordByPrimaryKey(resource: AdminForthResource, recordId: string): Promise<any> {
511511
return this.getRecordByPrimaryKeyWithOriginalTypes(resource, recordId).then((record) => {
512512
const newRecord = {};
513+
if (!record) {
514+
return null;
515+
}
513516
for (const col of resource.dataSourceColumns) {
514517
newRecord[col.name] = this.getFieldValue(col, record[col.name]);
515518
}

0 commit comments

Comments
 (0)