adminjs icon indicating copy to clipboard operation
adminjs copied to clipboard

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

Open diyorbekrustamjonov opened this issue 3 months ago • 0 comments

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

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

Related Issues

Closes #1678

diyorbekrustamjonov avatar Dec 02 '25 20:12 diyorbekrustamjonov