[PR #6923] [CLOSED] [WIP] fix(GenericInput): handle null date value to prevent crash on blur #13874

Closed
opened 2026-04-10 22:05:36 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/actualbudget/actual/pull/6923
Author: @kaigritun
Created: 2/9/2026
Status: Closed

Base: masterHead: fix/empty-date-rule-action


📝 Commits (1)

  • 3ad7006 fix(GenericInput): handle null date value to prevent crash on blur

📊 Changes

1 file changed (+2 additions, -2 deletions)

View changed files

📝 packages/desktop-client/src/components/util/GenericInput.tsx (+2 -2)

📄 Description

Summary

Fixes #6885 - Crash when rule has empty date field

Problem

When creating a rule with a "set date" action:

  1. Clicking the date entry field and then clicking elsewhere without entering a value
  2. Triggers DateSelect's onBlur handler which calls onSelect(null) for empty values
  3. GenericInput's condition typeof props.value !== 'string' evaluates to true for null (since typeof null === 'object')
  4. This causes RecurringSchedulePicker to render with a null value
  5. RecurringSchedulePicker calls getRecurringDescription(null, ...) which crashes accessing config.interval

Solution

  • Add null check: props.value != null && typeof props.value !== 'string' before rendering RecurringSchedulePicker
  • Ensure DateSelect receives an empty string instead of null: typeof props.value === 'string' ? props.value : ''

This ensures:

  • RecurringSchedulePicker only renders for actual RecurConfig objects
  • DateSelect handles null values gracefully by falling back to empty string

Testing

Verified the fix prevents the crash when:

  1. Creating a new rule
  2. Changing action to "set date"
  3. Clicking the date field then clicking elsewhere without entering a value

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/actualbudget/actual/pull/6923 **Author:** [@kaigritun](https://github.com/kaigritun) **Created:** 2/9/2026 **Status:** ❌ Closed **Base:** `master` ← **Head:** `fix/empty-date-rule-action` --- ### 📝 Commits (1) - [`3ad7006`](https://github.com/actualbudget/actual/commit/3ad7006cbf04a7600d8b0adcb6b4c57eac8d5611) fix(GenericInput): handle null date value to prevent crash on blur ### 📊 Changes **1 file changed** (+2 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `packages/desktop-client/src/components/util/GenericInput.tsx` (+2 -2) </details> ### 📄 Description ## Summary Fixes #6885 - Crash when rule has empty date field ## Problem When creating a rule with a "set date" action: 1. Clicking the date entry field and then clicking elsewhere without entering a value 2. Triggers DateSelect's onBlur handler which calls `onSelect(null)` for empty values 3. GenericInput's condition `typeof props.value !== 'string'` evaluates to true for null (since `typeof null === 'object'`) 4. This causes RecurringSchedulePicker to render with a null value 5. RecurringSchedulePicker calls `getRecurringDescription(null, ...)` which crashes accessing `config.interval` ## Solution - Add null check: `props.value != null && typeof props.value !== 'string'` before rendering RecurringSchedulePicker - Ensure DateSelect receives an empty string instead of null: `typeof props.value === 'string' ? props.value : ''` This ensures: - RecurringSchedulePicker only renders for actual RecurConfig objects - DateSelect handles null values gracefully by falling back to empty string ## Testing Verified the fix prevents the crash when: 1. Creating a new rule 2. Changing action to "set date" 3. Clicking the date field then clicking elsewhere without entering a value --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-10 22:05:36 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#13874