mirror of
https://github.com/Redocly/redoc.git
synced 2024-11-10 19:06:34 +03:00
Fix crash when content is empty map
This commit is contained in:
parent
5b3964e55b
commit
0ab1c71cb6
|
@ -23,7 +23,7 @@ export class MediaTypesSwitch extends React.Component<MediaTypesSwitchProps> {
|
|||
|
||||
render() {
|
||||
const { content } = this.props;
|
||||
if (!content || !content.mediaTypes) return null;
|
||||
if (!content || !content.mediaTypes || !content.mediaTypes.length) return null;
|
||||
const activeMimeIdx = content.activeMimeIdx;
|
||||
|
||||
let options = content.mediaTypes.map((mime, idx) => {
|
||||
|
|
Loading…
Reference in New Issue
Block a user