Skip to content

fix: handle undefined record.id in List component (fixes #1678) - #1798

Open
diyorbekrustamjonov wants to merge 1 commit into
SoftwareBrothers:masterfrom
diyorbekrustamjonov:fix/list-component-undefined-id-check
Open

fix: handle undefined record.id in List component (fixes #1678)#1798
diyorbekrustamjonov wants to merge 1 commit into
SoftwareBrothers:masterfrom
diyorbekrustamjonov:fix/list-component-undefined-id-check

Conversation

@diyorbekrustamjonov

Copy link
Copy Markdown

Fixes #1678

This PR fixes the TypeError: can't access property "toString", r.id is undefined error that occurs in the List component when BaseRecord.id() returns undefined or null.

Changes

  • Added null/undefined check (r.id != null) before accessing id property
  • Changed r.id.toString() to String(r.id) for safer type conversion
  • Prevents error when filtering selected records from URL query parameters

Testing

  • Tested with custom adapters where id might be undefined
  • Verified backward compatibility with existing adapters
  • No breaking changes

Related Issues

Closes #1678

…hers#1678)

- Add null check before calling toString() on record.id
- Use String() instead of toString() for safer conversion
- Prevents TypeError when BaseRecord.id() returns undefined

Fixes SoftwareBrothers#1678
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants