Bug 1497210 - Ensure a valid flex item prop is provided to the FlexItemSelector. r=pbro
authorGabriel Luong <gabriel.luong@gmail.com>
Thu, 11 Oct 2018 11:59:08 -0400
changeset 496451 e68617c25cbeaa0db57264bab8359f2073d07924
parent 496450 5095c0fdd000de42f501b7fea62a313871eca327
child 496452 1d69413fd4846cfe403d9019866dd091845156f4
push id9984
push userffxbld-merge
push dateMon, 15 Oct 2018 21:07:35 +0000
treeherdermozilla-beta@183d27ea8570 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspbro
bugs1497210
milestone64.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1497210 - Ensure a valid flex item prop is provided to the FlexItemSelector. r=pbro
devtools/client/inspector/flexbox/components/Header.js
--- a/devtools/client/inspector/flexbox/components/Header.js
+++ b/devtools/client/inspector/flexbox/components/Header.js
@@ -92,19 +92,24 @@ class Header extends PureComponent {
     const {
       flexContainer,
       setSelectedNode,
     } = this.props;
     const {
       flexItems,
       flexItemShown,
     } = flexContainer;
+    const flexItem = flexItems.find(item => item.nodeFront.actorID === flexItemShown);
+
+    if (!flexItem) {
+      return null;
+    }
 
     return FlexItemSelector({
-      flexItem: flexItems.find(item => item.nodeFront.actorID === flexItemShown),
+      flexItem,
       flexItems,
       setSelectedNode,
     });
   }
 
   render() {
     const {
       flexContainer,