Skip to content

Commit

Permalink
Add handling for undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
thienlnam committed Oct 21, 2023
1 parent dcb698f commit 3cc6f87
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/libs/ReportUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -3403,8 +3403,16 @@ function parseReportRouteParams(route) {
}

const pathSegments = parsingRoute.split('/');

const reportIDSegment = pathSegments[1];

// Check for "undefined" or any other unwanted string values
if (!reportIDSegment || reportIDSegment === "undefined") {
return {reportID: '', isSubReportPageRoute: false};
}

return {
reportID: pathSegments[1],
reportID: reportIDSegment,
isSubReportPageRoute: pathSegments.length > 2,
};
}
Expand Down

0 comments on commit 3cc6f87

Please sign in to comment.