Skip to content

Commit

Permalink
Fix join_by_key
Browse files Browse the repository at this point in the history
  • Loading branch information
crespocarlos committed Nov 8, 2024
1 parent 1620988 commit a186a60
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export type JoinedReturnType<
function getValueByPath(obj: any, path: string): any {
return path.split('.').reduce((acc, keyPart) => {
// Check if acc is a valid object and has the key
return Object.prototype.hasOwnProperty.call(acc, keyPart) ? acc[keyPart] : undefined;
return acc && Object.prototype.hasOwnProperty.call(acc, keyPart) ? acc[keyPart] : undefined;
}, obj);
}

Expand Down

0 comments on commit a186a60

Please sign in to comment.