APIv4 Explorer: Only show result length if result is array
authorColeman Watts <coleman@civicrm.org>
Fri, 11 Sep 2020 18:18:11 +0000 (14:18 -0400)
committerColeman Watts <coleman@civicrm.org>
Mon, 14 Sep 2020 19:08:36 +0000 (15:08 -0400)
ang/api4Explorer/Explorer.js

index 41750691c61c750370d9a06e2caa3b461a386f6f..7c64b6e6671c9d1e39d974db47e59bce121fed48 100644 (file)
           $scope.debug = debugFormat(resp.data);
           $scope.result = [
             formatMeta(resp.data),
-            prettyPrintOne('(' + resp.data.values.length + ') ' + _.escape(JSON.stringify(resp.data.values, null, 2)), 'js', 1)
+            prettyPrintOne((_.isArray(resp.data.values) ? '(' + resp.data.values.length + ') ' : '') + _.escape(JSON.stringify(resp.data.values, null, 2)), 'js', 1)
           ];
         }, function(resp) {
           $scope.loading = false;