[Due for payment 2026-12-08] [$175] [Sentry: APP-PCJ] Object.values requires that input parameter not be null or undefined in MoneyRequestView hasEnabledOptions
Sentry
https://expensify.sentry.io/issues/APP-PCJ
Impact
- 1 user, 2 events.
- First seen: 2026-11-18 21:59 UTC.
- Unhandled fatal React render error;
app_blocking: true. - Route:
/search(Search_Root, transaction preview /MoneyRequestView).
Platform and release
- Web, standalone; Safari on Mac.
- Release:
[email protected].
Top first-party frames
src/libs/OptionsListUtils/index.ts:929 — hasEnabledOptions
Object.values(options).some(isOptionEnabled)
MoneyRequestView.tsx:1213 — tagList
canEditTag && hasEnabledOptions(tags)
MoneyRequestView.tsx:1211 — ReportActionItem_MoneyRequestView
policyTagLists.map(({name, orderWeight, tags}, index) => ...)
Root cause
MoneyRequestView passes tags directly to hasEnabledOptions(), which calls Object.values() without a null guard.
PolicyUtils explicitly documents that empty tag lists can arrive without the tags key. getTagLists() preserves these records, and other tag utilities already tolerate missing tags.
For an editable expense with no displayed tag and nondependent tags, the render expression passes the missing value into Object.values(), causing the crash. The precise user action that produced the empty list has not been confirmed.
Suggested fix
Normalize missing tags with hasEnabledOptions(tags ?? {}), or make the shared helper explicitly accept and handle nullish inputs after reviewing its callers.
Add regression coverage for rendering an editable expense with an empty tag-list record lacking tags. The preview should render without crashing and omit the empty tag row.
Existing issues
Searches in Expensify/App and Expensify/Expensify for APP-PCJ, the exact error text, and related function/crash terms found no matching tracking issue.
Upwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~022123555416011104711
- Upwork Job ID: 2123555416011104711
- Last Price Increase: 2026-11-19
Issue Owner
Current Issue Owner: @jayeshmangwani
Triggered auto assignment to Contributor-plus team member for initial proposal review - @jayeshmangwani (External)
Job added to Upwork: https://www.upwork.com/jobs/~022123555416011104711
Proposal
What is the root cause of that problem?
An empty policy tag list can legitimately omit tags, but hasEnabledOptions() assumes its input is always present and calls Object.values() without checking.
In MoneyRequestView, this throws when the expense is editable, the affected tag level has no displayed value, and the lists are nondependent. Tag rows are computed before the visibility check, so hiding the empty tag section does not prevent the crash.
Confidence: Medium. The code explains the reported stack, but the affected user’s policy data and exact release source were not independently verified. No browser reproduction was performed.
Supporting code evidence
- The missing-property representation is explicitly documented in PolicyUtils/tag.ts:317–345.
- getTagLists():47–55 preserves these records without normalizing their nested tags.
- MoneyRequestView.tsx:1213–1218 passes the missing value into hasEnabledOptions():930–942, where
Object.values(undefined)throws. - An empty object is safe; disabled options alone do not explain this exception. Missing tags are a documented runtime shape, so backend corruption is not required.
What changes do you think we should make in order to solve the problem?
Make hasEnabledOptions() explicitly accept undefined and null and return false for either. Preserve its existing handling of enabled, disabled, and pending-deletion options.
This addresses the reported crash and the same unsafe-input pattern in other tag callers without changing list ordering or visibility rules.
Scope and regression coverage
Other direct callers include TagsOptionsListUtils.ts:261–279 and ExpenseDefaultRulePageBase.tsx:279–285.
Add regression coverage for:
- Nullish and empty helper inputs returning
false, while existing option semantics remain unchanged. - An editable, untagged expense with a policy list genuinely omitting
tags: the preview renders and omits the empty row. - Independent multilevel lists with one empty list and one enabled sibling: only the appropriate row appears.
Existing render-test setup: MoneyRequestViewTest.tsx:341–389.
What alternative solutions did you explore?
A caller-only tags ?? {} fallback fixes this stack but leaves other callers exposed. Filtering empty lists out globally is inappropriate because it could change tag-level indices and discard list metadata.
Next Steps for Contributor+ team:
To accept: @MelvinBot implement this to create a draft PR.
To refine: @MelvinBot <your feedback>
To reject: Explain why you are rejecting Melvin's proposal.
Proposal
Please re-state the problem that we are trying to solve in this issue.
When viewing an expense in MoneyRequestView where a policy has a tag list that omits tags (an empty tag list), the application crashes with a fatal runtime error:
TypeError: Object.values requires that input parameter not be null or undefined inside hasEnabledOptions.
What is the root cause of that problem?
In src/components/ReportActionItem/MoneyRequestView.tsx:1213-1215:
const tagList = policyTagLists.map(({name, orderWeight, tags}, index) => {
const tagForDisplay = getTagForDisplay(updatedTransaction ?? transaction, shouldShowFullTransactionTag ? undefined : index);
const shouldShow = hasDependentTags ? !!shouldShowTagList.at(index) : !!tagForDisplay || (canEditTag && hasEnabledOptions(tags));
When an empty tag list is returned from PolicyUtils/tag.ts, the list object legitimately omits the tags property (i.e. tags === undefined).
When canEditTag is true and the transaction currently has no tag set (!tagForDisplay), hasEnabledOptions(tags) is called with undefined.
In src/libs/OptionsListUtils/index.ts:940-942:
function hasEnabledOptions(options: PolicyCategories | PolicyTag[]): boolean {
return Object.values(options).some(isOptionEnabled);
}
hasEnabledOptions() does not have a null/undefined guard and immediately calls Object.values(options). In JavaScript, Object.values(undefined) and Object.values(null) throw a fatal TypeError, crashing the view and triggering Sentry event APP-PCJ.
What changes do you think we should make in order to solve the problem?
Update hasEnabledOptions() in src/libs/OptionsListUtils/index.ts to accept optional/nullish options and safely return false:
/**
* Verifies that there is at least one enabled option
*/
function hasEnabledOptions(options?: PolicyCategories | PolicyTag[] | null): boolean {
if (!options) {
return false;
}
return Object.values(options).some(isOptionEnabled);
}
This guarantees:
- If
tagsisundefinedornull,hasEnabledOptions(tags)returnsfalsecleanly. - In
MoneyRequestView.tsx,shouldShowevaluates tofalse, gracefully hiding the empty tag row without crashing. - All other callers across the codebase (e.g.
TagsOptionsListUtils.ts,ExpenseDefaultRulePageBase.tsx) are globally protected against nullish inputs without needing repetitive?? {}null-coalescing guards at each call site.
Additionally, add regression tests in tests/unit/OptionsListUtilsTest.ts:
it('returns false when options is null, undefined, or empty', () => {
expect(hasEnabledOptions(undefined)).toBe(false);
expect(hasEnabledOptions(null)).toBe(false);
expect(hasEnabledOptions({})).toBe(false);
expect(hasEnabledOptions([])).toBe(false);
});
What alternative solutions did you explore?
- Fallback in
MoneyRequestView.tsx(hasEnabledOptions(tags ?? {})): While this prevents the crash inMoneyRequestView, it leaves the other 16 call sites across the application vulnerable to identical nullish crashes. Handling it insidehasEnabledOptions()fixes the issue at its root. - Filtering empty lists in
getTagLists(): Not recommended because removing empty tag lists could mutate order weights, order indices, and dependent tag level alignment.
Proposal
Please re-state the problem that we are trying to solve in this issue.
Opening an expense in Search can crash the app with "Object.values requires that input parameter not be null or undefined", thrown from hasEnabledOptions while MoneyRequestView builds its tag rows.
What is the root cause of that problem?
MoneyRequestView calls hasEnabledOptions(tags) for every tag list, and hasEnabledOptions calls Object.values(options) with no guard. An empty tag list arrives from the server without the tags key (hasDependentTags in src/libs/PolicyUtils/tag.ts already notes this), so tags is undefined and Object.values throws.
There is a second way to get a tag list with no tags: renamePolicyTagList merges {[newName]: {pendingAction: null}} on success. If the list was renamed again before that request finished, the merge recreates the old name as {pendingAction: null}, a record with no name, orderWeight or tags. getTagLists only filters null, so this leftover also reaches MoneyRequestView.
I couldn't reproduce the crash in the app: the issue has no repro steps, and the user action that produced the list isn't known. This is traced from the Sentry stack and the code.
What changes do you think we should make in order to solve the problem?
- Make
hasEnabledOptionsacceptundefinedandnulland returnfalsefor them, so real empty tag lists stop crashing every caller. - In
getTagLists, also drop leftover records that have noname:.filter((tagList) => !!tagList && !!tagList.name). Real tag lists, empty ones included, always have a name, so tag-level indices are unchanged. This stops the rename leftover from showing up as a blank, unsortable tag row inMoneyRequestViewand in the othergetTagListscallers.setPolicyTagsRequiredalready filters on!!tagList.namefor the same reason. - Unit tests:
hasEnabledOptions(undefined)andhasEnabledOptions(null)returnfalse;getTagListskeeps an empty named list and drops a{pendingAction: null}record.
What alternative solutions did you explore?
Filtering on tags in getTagLists. That would drop real empty tag lists and shift the tag-level index that getTagForDisplay uses, so it is not safe.
📣 @okie07! 📣 Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork. Please follow these steps:
- Make sure you've read and understood the contributing guidelines.
- Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
- Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
- Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>
@jayeshmangwani can you move this ahead please?
Contributor details Your Expensify account email: [email protected] Upwork Profile Link: https://www.upwork.com/freelancers/~01e1a10b20c43f3060
✅ Contributor details stored successfully. Thank you for contributing to Expensify!
Draft PR opened: https://github.com/Expensify/App/pull/107663
Root-cause fix: hasEnabledOptions() (src/libs/OptionsListUtils/index.ts) now accepts nullish options and returns false instead of calling Object.values() on them, which fixes the APP-PCJ crash for all callers (incl. MoneyRequestView). Also guarded the same pattern in getEnabledTags() (src/libs/TagsOptionsListUtils.ts). Added regression unit tests (null/undefined/{}/[]/disabled/pending-deletion) and MoneyRequestView render tests for an editable expense with an empty tag list lacking the tags key — verified they fail before the fix at the exact stack frame (index.ts:941) and pass after.
📣 @DeviousCardi! 📣 Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork. Please follow these steps:
- Make sure you've read and understood the contributing guidelines.
- Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
- Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
- Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>
Hi @jayeshmangwani, gentle Monday morning bump on this! Ready to take this forward — my proposal addresses the exact root cause with regression unit tests for hasEnabledOptions, contributor details are verified and on file, and the branch is ready to open a clean PR immediately once assigned.
@MelvinBot implement https://github.com/Expensify/App/issues/107487
🤖 Web test steps verification results: ❌ fail
Web verification was blocked by a blank development-app page. The required missing-tags fixture could not be created or confirmed.

| Step | Status |
|---|---|
Preview renders without the empty tag rowBlocked: Search was inaccessible.![]() |
❌ |
Enabled sibling tag row remains editableBlocked: the required fixture could not be established. |
❌ |
No related JavaScript console errorsNot verified; supported console inspection was unavailable. |
❌ |
Implemented in Prevent expense preview crash on missing tag collections, a draft assigned to jayeshmangwani.
Automated validation: 478 relevant tests passed, including regressions that reproduced the crash before the fix. Lint, typecheck, spelling, formatting, and Storybook smoke checks passed. The full suite timed out after 10 minutes; the legacy Prettier command is unavailable in this checkout.
view run · no recording available
Hi @jayeshmangwani, seeing that MelvinBot failed the web test verification fixture and draft PR #107694 reached its step limit — just a gentle reminder that my proposal and verified fix (with unit tests covering the hasEnabledOptions guard) are ready to open as a clean contributor PR whenever you'd like to assign!
@jayeshmangwani
The solution for this issue has been :rocket: deployed to production :rocket: in version 9.5.55-6 and is now subject to a 7-day regression period :calendar:. Here is the list of pull requests that resolve this issue:
- https://github.com/Expensify/App/pull/107694
If no regressions arise, payment will be issued on 2026-12-08. :confetti_ball:
The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the Contributor+ Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]. If no checklist is needed for this issue, you can click: [no checklist button]