Skip to content

Commit

Permalink
fix #10107
Browse files Browse the repository at this point in the history
  • Loading branch information
plansoft-admin committed Aug 2, 2024
1 parent 75f75a8 commit 639a0e5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions packages/ra-core/src/i18n/useTranslatable.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ describe('useTranslatable', () => {
// Given the record { title: { en: 'title_en', fr: 'title_fr' } } and the locale 'fr',
// the record for the locale 'fr' will be { title: 'title_fr' }
const record = {
nullEntry: null,
fractal: true,
title: { en: 'title_en', fr: 'title_fr' },
items: [
Expand All @@ -16,6 +17,7 @@ describe('useTranslatable', () => {
const recordForLocale = getRecordForLocale(record, 'fr');

expect(recordForLocale).toEqual({
nullEntry: null,
fractal: true,
title: 'title_fr',
items: [
Expand Down
2 changes: 1 addition & 1 deletion packages/ra-core/src/i18n/useTranslatable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ const getRecordPaths = (
path: Array<string> = []
): Array<Array<string>> => {
return Object.entries(record).reduce((acc, [key, value]) => {
if (typeof value === 'object') {
if (value !== null && typeof value === 'object') {
return [
...acc,
[...path, key],
Expand Down

0 comments on commit 639a0e5

Please sign in to comment.