Skip to content

Commit

Permalink
Fix : When multilingual is not checked the language cancellation lead…
Browse files Browse the repository at this point in the history
…s to a blank page [SDESK-6856] (#1775)

* Fix : When multilingual is not checked the language cancellation leads to a blank page [SDESK-6856]

* refactoring code
  • Loading branch information
devketanpro authored Mar 23, 2023
1 parent 4ccfff9 commit ca4daac
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion client/components/fields/editor/Language.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export class EditorFieldLanguageComponent extends React.PureComponent<IProps> {
const baseField = this.props.field ?? 'language';
const field = !isMultilingual ? baseField : `${baseField}s`;

const values = get(this.props.item, field, this.props.defaultValue || []);
const values = get(this.props.item, field, this.props.defaultValue || []) ?? [];
const showMainLanguageChoice = (
isMultilingual === true &&
values.length > 1 &&
Expand Down

0 comments on commit ca4daac

Please sign in to comment.