adminjs
adminjs copied to clipboard
fix: handle undefined record.id in List component (fixes #1678)
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 accessingidproperty - Changed
r.id.toString()toString(r.id)for safer type conversion - Prevents error when filtering selected records from URL query parameters
Testing
- [x] Tested with custom adapters where
idmight be undefined - [x] Verified backward compatibility with existing adapters
- [x] No breaking changes
Related Issues
Closes #1678