Skip to content

Commit

Permalink
check if value exists, dont try to trim null
Browse files Browse the repository at this point in the history
  • Loading branch information
chiaberry committed Oct 4, 2024
1 parent 610c3c4 commit 44b9852
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions moped-editor/src/views/projects/projectView/ProjectFiles.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ const useColumns = ({
editable: true,
// validate input
preProcessEditCellProps: (params) => {
const hasError = params.props.value.trim().length < 1;
const hasError = !params.props.value || params.props.value.trim().length < 1;
return { ...params.props, error: hasError };
},
renderEditCell: (props) => (
Expand All @@ -103,7 +103,7 @@ const useColumns = ({
editable: true,
// validate input
preProcessEditCellProps: (params) => {
const hasError = params.props.value.trim().length < 1;
const hasError = !params.props.value || params.props.value.trim().length < 1;
return { ...params.props, error: hasError };
},
renderCell: ({ row }) => {
Expand Down

0 comments on commit 44b9852

Please sign in to comment.