From 3ce2a36ac0384d685926d68f650691cf83ffe810 Mon Sep 17 00:00:00 2001 From: Marco van Dijk Date: Thu, 28 Apr 2022 11:39:36 +0200 Subject: [PATCH] Fix crash if viewing the orch inspector before 3box info loads in --- src/components/OrchAddressViewer.js | 2 +- src/components/OrchInfoViewer.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/OrchAddressViewer.js b/src/components/OrchAddressViewer.js index 8960f90..0fc9341 100644 --- a/src/components/OrchAddressViewer.js +++ b/src/components/OrchAddressViewer.js @@ -34,7 +34,7 @@ const Address = (obj) => { } } // Lookup current info in cache only if this addr has a mapped ENS domain - if (thisDomain && thisDomain.domain) { + if (thisDomain && thisDomain.domain && livepeer.ensInfoMapping && livepeer.ensInfoMapping.length) { for (const thisAddr of livepeer.ensInfoMapping) { if (thisAddr.domain === thisDomain.domain) { thisInfo = thisAddr; diff --git a/src/components/OrchInfoViewer.js b/src/components/OrchInfoViewer.js index a67536f..f5a5d00 100644 --- a/src/components/OrchInfoViewer.js +++ b/src/components/OrchInfoViewer.js @@ -88,7 +88,7 @@ const OrchInfoViewer = (obj) => { } } // Lookup current info in cache only if this addr has a mapped ENS domain - if (thisDomain && thisDomain.domain) { + if (thisDomain && thisDomain.domain && livepeer.ensInfoMapping && livepeer.ensInfoMapping.length) { for (const thisAddr of livepeer.ensInfoMapping) { if (thisAddr.domain === thisDomain.domain) { thisInfo = thisAddr; @@ -178,7 +178,7 @@ const OrchInfoViewer = (obj) => { } return ( -
+