Skip to content

Commit

Permalink
fix(Topbar): update check for null children
Browse files Browse the repository at this point in the history
  • Loading branch information
pauljeter committed Sep 27, 2019
1 parent 076756d commit a3f0aa2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions react/src/lib/Topbar/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/** @component topbar */

import React from 'react';
import PropTypes from 'prop-types';
import React from 'react';
import { prefix } from '../utils/index';

class Topbar extends React.Component {
Expand Down Expand Up @@ -58,7 +58,7 @@ class Topbar extends React.Component {
);

const injectChildren = React.Children.map(children, child => {
if ((child.type.displayName === 'TopbarMobile') && (!child.props.brandNode)) {
if (child && (child.type.displayName === 'TopbarMobile') && (!child.props.brandNode)) {
return React.cloneElement(child, {
brandNode
});
Expand Down

0 comments on commit a3f0aa2

Please sign in to comment.