From 31efd3002f74763423f30a474d017fe8fb7daf3d Mon Sep 17 00:00:00 2001 From: Taha Yassine Kraiem Date: Thu, 21 Apr 2022 13:05:49 +0200 Subject: [PATCH] feat(api): custom metrics handle wrong try-sessions payload --- api/chalicelib/core/custom_metrics.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/api/chalicelib/core/custom_metrics.py b/api/chalicelib/core/custom_metrics.py index 236533b99..ab0b7d15f 100644 --- a/api/chalicelib/core/custom_metrics.py +++ b/api/chalicelib/core/custom_metrics.py @@ -107,6 +107,8 @@ def get_sessions(project_id, user_id, metric_id, data: schemas.CustomMetricSessi def try_sessions(project_id, user_id, data: schemas.CustomMetricSessionsPayloadSchema): results = [] + if data.series is None: + return results for s in data.series: s.filter.startDate = data.startTimestamp s.filter.endDate = data.endTimestamp