Skip to content

Commit

Permalink
Handle null extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
euanmillar committed Jan 2, 2025
1 parent d27be1d commit 6fdda76
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/commons/src/fhir/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,6 @@ export function findExtension<URL extends AllExtensions['url']>(
): Extract<AllExtensions, { url: URL }> | undefined {
return listOfExtensions.find(
(extension): extension is Extract<AllExtensions, { url: URL }> =>
extension.url === url
extension && extension.url === url
)
}
2 changes: 1 addition & 1 deletion packages/search/src/features/fhir/fhir-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export function findTaskExtension<
Task extends TaskHistory | SavedTask
>(task: Task, extensionUrl: T) {
return task.extension.find(
(ext): ext is KnownExtensionType[T] => ext.url === extensionUrl
(ext): ext is KnownExtensionType[T] => ext && ext.url === extensionUrl
)
}

Expand Down

0 comments on commit 6fdda76

Please sign in to comment.