Skip to content

Commit

Permalink
Merge pull request #275 from wri/TM-997-application-error-on-project-…
Browse files Browse the repository at this point in the history
…stablishment-form

[TM-997] Fix: Ensure "record.uuid" is safely accessed in getSiteBbox function
  • Loading branch information
LimberHope authored Jun 24, 2024
2 parents 9960da8 + 4447b9e commit 460e29a
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/components/extensive/WizardForm/FormSummaryRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -213,11 +213,16 @@ const getSitePolygonData = (record: any) => {
};

const getSiteBbox = (record: any) => {
const { data: sitePolygonBbox } = useGetV2SitesSiteBbox({
pathParams: {
site: record.uuid
const { data: sitePolygonBbox } = useGetV2SitesSiteBbox(
{
pathParams: {
site: record?.uuid
}
},
{
enabled: record?.uuid != null
}
});
);
return sitePolygonBbox?.bbox;
};

Expand Down

0 comments on commit 460e29a

Please sign in to comment.