Skip to content

Commit

Permalink
Add null check
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamindehli committed May 1, 2024
1 parent 2663f80 commit 70c61e7
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/components/Template/DefaultTextField.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export function DefaultTextField({
onChange={onChange}
label={labelWithFallback}
endAdornment={
helperText?.length && (
!!helperText?.length && (
<InputAdornment position="end">
<IconButton
aria-label="toggle password visibility"
Expand All @@ -67,9 +67,11 @@ export function DefaultTextField({
)
}
/>
<Collapse in={showHelperText}>
<FormHelperText id={helperTextId}>{helperText}</FormHelperText>
</Collapse>
{!!helperText?.length && (
<Collapse in={showHelperText}>
<FormHelperText id={helperTextId}>{helperText}</FormHelperText>
</Collapse>
)}
</FormControl>
);
}

0 comments on commit 70c61e7

Please sign in to comment.