Skip to content

Commit

Permalink
Merge pull request #5687 from Expensify/amal-fail-policy-create
Browse files Browse the repository at this point in the history
Fix error condition for policy create
  • Loading branch information
Amal Nazeem authored Oct 8, 2021
2 parents 05f0adf + 820b8cb commit a860c59
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/libs/actions/Policy.js
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,10 @@ function create(name = '') {
role: CONST.POLICY.ROLE.ADMIN,
});
}).then(() => {
Navigation.dismissModal();
Navigation.navigate(ROUTES.getWorkspaceCardRoute(res.policyID));
if (res) {
Navigation.dismissModal();
Navigation.navigate(ROUTES.getWorkspaceCardRoute(res.policyID));
}
});
}

Expand Down

0 comments on commit a860c59

Please sign in to comment.