diff --git a/src/widgets/customapi/component.jsx b/src/widgets/customapi/component.jsx index 6acccd3ea..282cb0a5f 100644 --- a/src/widgets/customapi/component.jsx +++ b/src/widgets/customapi/component.jsx @@ -5,7 +5,7 @@ import Block from "components/services/widget/block"; import useWidgetAPI from "utils/proxy/use-widget-api"; function getLength(data) { - if ("length" in data) { + if (Array.isArray(data) || typeof data === "string") { return data.length; } else if (typeof data === "object" && data !== null) { return Object.keys(data).length;