mirror of
https://github.com/Redocly/redoc.git
synced 2025-02-07 21:40:32 +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() {
|
render() {
|
||||||
const { content } = this.props;
|
const { content } = this.props;
|
||||||
if (!content || !content.mediaTypes) return null;
|
if (!content || !content.mediaTypes || !content.mediaTypes.length) return null;
|
||||||
const activeMimeIdx = content.activeMimeIdx;
|
const activeMimeIdx = content.activeMimeIdx;
|
||||||
|
|
||||||
let options = content.mediaTypes.map((mime, idx) => {
|
let options = content.mediaTypes.map((mime, idx) => {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user