mirror of
https://github.com/utopia-os/utopia-ui.git
synced 2025-12-13 07:46:10 +00:00
Don't crash when text field is not set (#147)
This commit is contained in:
parent
0ec0f13c74
commit
1357a18b65
@ -17,9 +17,7 @@ export const ProfileTextView = ({
|
|||||||
}) => {
|
}) => {
|
||||||
const text = get(item, dataField)
|
const text = get(item, dataField)
|
||||||
|
|
||||||
if (typeof text !== 'string') {
|
const parsedText = typeof text !== 'string' ? '' : text
|
||||||
throw new Error('ProfileTextView: text is not a string')
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className='tw-my-10 tw-mt-2 tw-px-6'>
|
<div className='tw-my-10 tw-mt-2 tw-px-6'>
|
||||||
@ -27,7 +25,7 @@ export const ProfileTextView = ({
|
|||||||
<h2 className='tw-text-lg tw-font-semibold'>{heading}</h2>
|
<h2 className='tw-text-lg tw-font-semibold'>{heading}</h2>
|
||||||
)}
|
)}
|
||||||
<div className='tw-mt-2 tw-text-sm'>
|
<div className='tw-mt-2 tw-text-sm'>
|
||||||
<TextView itemId={item.id} rawText={text} />
|
<TextView itemId={item.id} rawText={parsedText} />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user