Query results fail to load when stats field is missing
Adds an extra check to prevent throwing a TypeError when the
stats response does not have one of the expected fields.
diff --git a/app/addons/documents/mango/components/ExecutionStats.js b/app/addons/documents/mango/components/ExecutionStats.js
index 5c043d1..48b815a 100644
--- a/app/addons/documents/mango/components/ExecutionStats.js
+++ b/app/addons/documents/mango/components/ExecutionStats.js
@@ -53,8 +53,11 @@
}
executionStatsLine(title, value, alwaysShow = false, units = "") {
- const hasValue = value === 0 && !alwaysShow ? "false" : "true";
- return <div data-status={hasValue}>{title + ": "}<span className="value">{value.toLocaleString()} {units}</span></div>;
+ if (typeof value === 'number') {
+ const hasValue = value === 0 && !alwaysShow ? "false" : "true";
+ return <div data-status={hasValue}>{title + ": "}<span className="value">{value.toLocaleString()} {units}</span></div>;
+ }
+ return null;
}
executionStatsPopupComponent(executionStats) {