Skip to content

Commit

Permalink
Merge pull request #28475 from rezkiy37/fix/28470-empty-string-inside…
Browse files Browse the repository at this point in the history
…-recently-used-categories

Check a category before adding to recently used categories on Money Request
  • Loading branch information
puneetlath authored Oct 10, 2023
2 parents e559308 + 01983ba commit f550882
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/libs/actions/IOU.js
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,10 @@ function getMoneyRequestInformation(
billable,
);

const optimisticPolicyRecentlyUsedCategories = Policy.buildOptimisticPolicyRecentlyUsedCategories(iouReport.policyID, category);
let optimisticPolicyRecentlyUsedCategories = [];
if (category) {
optimisticPolicyRecentlyUsedCategories = Policy.buildOptimisticPolicyRecentlyUsedCategories(iouReport.policyID, category);
}

const optimisticPolicyRecentlyUsedTags = {};
const policyTags = allPolicyTags[`${ONYXKEYS.COLLECTION.POLICY_TAGS}${iouReport.policyID}`];
Expand Down

0 comments on commit f550882

Please sign in to comment.