diff --git a/src/libs/Navigation/AppNavigator/createCustomStackNavigator/CustomRouter.js b/src/libs/Navigation/AppNavigator/createCustomStackNavigator/CustomRouter.js index 890db2b45ad4..42caad5b3969 100644 --- a/src/libs/Navigation/AppNavigator/createCustomStackNavigator/CustomRouter.js +++ b/src/libs/Navigation/AppNavigator/createCustomStackNavigator/CustomRouter.js @@ -12,11 +12,11 @@ const isAtLeastOneCentralPaneNavigatorInState = (state) => _.find(state.routes, /** * @param {Object} state - react-navigation state - * @returns {String|undefined} + * @returns {String} */ const getTopMostReportIDFromRHP = (state) => { if (!state) { - return; + return ''; } const topmostRightPane = lodashFindLast(state.routes, (route) => route.name === NAVIGATORS.RIGHT_MODAL_NAVIGATOR); @@ -33,6 +33,8 @@ const getTopMostReportIDFromRHP = (state) => { if (topmostRoute.params && topmostRoute.params.reportID) { return topmostRoute.params.reportID; } + + return ''; }; /** * Adds report route without any specific reportID to the state.