Fix NPE in DataDescription
Summary: Fixed NPE found during exploratory testing Layout Inspector Reviewed By: nikoant Differential Revision: D24783042 fbshipit-source-id: 38d76d677941bcfe8ecfa2e165ed4ea421c32edf
This commit is contained in:
committed by
Facebook GitHub Bot
parent
e92145d2fd
commit
b8b9c4296a
@@ -718,7 +718,7 @@ class DataDescriptionContainer extends PureComponent<{
|
|||||||
case 'array':
|
case 'array':
|
||||||
return val.length <= 0 ? <EmptyObjectValue>[]</EmptyObjectValue> : null;
|
return val.length <= 0 ? <EmptyObjectValue>[]</EmptyObjectValue> : null;
|
||||||
case 'object':
|
case 'object':
|
||||||
return Object.keys(val).length <= 0 ? (
|
return Object.keys(val ?? {}).length <= 0 ? (
|
||||||
<EmptyObjectValue>{'{}'}</EmptyObjectValue>
|
<EmptyObjectValue>{'{}'}</EmptyObjectValue>
|
||||||
) : null;
|
) : null;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user