From ef5088a6aa940234397eb96a742ba030c2bebaea Mon Sep 17 00:00:00 2001 From: Abhishek Singla Date: Tue, 14 Jun 2022 19:04:42 +0000 Subject: [PATCH] to convert seconds to ms --- .../dashboards/frontend/public/javascripts/countly.models.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/dashboards/frontend/public/javascripts/countly.models.js b/plugins/dashboards/frontend/public/javascripts/countly.models.js index fbd6cef3ec0..44265df67a7 100644 --- a/plugins/dashboards/frontend/public/javascripts/countly.models.js +++ b/plugins/dashboards/frontend/public/javascripts/countly.models.js @@ -317,7 +317,7 @@ create: function(context, widget) { var dashboardId = context.rootGetters["countlyDashboards/selected"].id; var settings = widget.settings || {}; - if (widget.settings.custom_period && typeof widget.settings.custom_period === "object") { + if (widget.settings && widget.settings.custom_period && typeof widget.settings.custom_period === "object") { if (Array.isArray(widget.settings.custom_period)) { if (widget.settings.custom_period[0] && widget.settings.custom_period[0].toString().length === 13) { widget.settings.custom_period[0] = Math.floor(widget.settings.custom_period[0] / 1000); @@ -343,7 +343,7 @@ var dashboardId = context.rootGetters["countlyDashboards/selected"].id; var widgetId = widget.id; var settings = widget.settings; - if (widget.settings.custom_period && typeof widget.settings.custom_period === "object") { + if (widget.settings && widget.settings.custom_period && typeof widget.settings.custom_period === "object") { if (Array.isArray(widget.settings.custom_period)) { if (widget.settings.custom_period[0] && widget.settings.custom_period[0].toString().length === 13) { widget.settings.custom_period[0] = Math.floor(widget.settings.custom_period[0] / 1000);