From de90bdbd19c4bc4840d79f29946b59c7ef8ba25e Mon Sep 17 00:00:00 2001 From: Chi Vinh Le Date: Fri, 18 Aug 2017 21:19:13 +0700 Subject: [PATCH] Gracefully handle when data is not available --- client/coral-framework/hocs/withFragments.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/client/coral-framework/hocs/withFragments.js b/client/coral-framework/hocs/withFragments.js index 33c39abd0..e6aca318a 100644 --- a/client/coral-framework/hocs/withFragments.js +++ b/client/coral-framework/hocs/withFragments.js @@ -30,7 +30,9 @@ function filterProps(props, fragments) { if (!(key in props)) { return; } - filtered[key] = filter(fragments[key], props[key], props.data.variables); + filtered[key] = props.data + ? filter(fragments[key], props[key], props.data.variables) + : props[key]; }); return filtered; }