Skip to content

Commit

Permalink
feat(tree-cover): validate if data is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
willian-viana committed Nov 13, 2024
1 parent e6a73c3 commit 5f3a5c8
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ export default {
return getTreeCoverGainByPlantationType(params).then((response) => {
const { data } = (response && response.data) || {};

if (data?.length === 0) return null;

const totalArea = data.reduce(
(prev, curr) => prev + curr?.gain_area_ha,
0
Expand Down

0 comments on commit 5f3a5c8

Please sign in to comment.