From a211bd0d0896677f9a36dbd33a246258d35a6af7 Mon Sep 17 00:00:00 2001 From: Barry Gitarts Date: Sat, 15 Dec 2018 16:19:24 -0500 Subject: [PATCH] ensure insights doesn't break load --- app/components/TransfersGraph.jsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/components/TransfersGraph.jsx b/app/components/TransfersGraph.jsx index 62a9bb6..def6db1 100644 --- a/app/components/TransfersGraph.jsx +++ b/app/components/TransfersGraph.jsx @@ -2,11 +2,12 @@ import Cytoscape from 'cytoscape' import dagre from 'cytoscape-dagre' import React, { Fragment } from 'react' import CytoscapeComponent from 'react-cytoscapejs' -import { uniq } from 'ramda' +import { uniq, isNil } from 'ramda' import { toEther } from '../utils/conversions' import { getTokenLabel } from '../utils/currencies' import { FundingContext } from '../context' + Cytoscape.use(dagre) const layout = { name: 'dagre' } @@ -36,6 +37,7 @@ const stylesheet = [ const getAuthorizations = events => events.filter(event => event.event === 'AuthorizePayment') const createElements = (transfers, vaultEvents) => { + if (isNil(transfers) || isNil(vaultEvents)) return [] const nodes = [] const edges = [] const authorizations = getAuthorizations(vaultEvents) @@ -76,7 +78,7 @@ const TransfersGraph = () => {