Fix "Cannot read properties of undefined". Closes #3070

This commit is contained in:
Deluan 2024-07-25 17:22:04 -04:00
parent 76c3f5131a
commit 7b2ddfd65a

View file

@ -13,6 +13,7 @@ const useStyles = makeStyles((theme) => ({
export const SizeField = ({ source, ...rest }) => {
const classes = useStyles()
const record = useRecordContext(rest)
if (!record) return null
return <span className={classes.root}>{formatBytes(record[source])}</span>
}