From 5bf3fbc93b93cd415e1460877051854c76ae0a28 Mon Sep 17 00:00:00 2001 From: Bnyro Date: Mon, 25 Nov 2024 16:57:03 +0100 Subject: [fix] openmetrics: value is None if there's no data --- searx/openmetrics.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'searx/openmetrics.py') diff --git a/searx/openmetrics.py b/searx/openmetrics.py index 5232e05ca..2cc89839b 100644 --- a/searx/openmetrics.py +++ b/searx/openmetrics.py @@ -26,7 +26,7 @@ class OpenMetricsFamily: # pylint: disable=too-few-public-methods """ for i, data_info_dict in enumerate(self.data_info): - if not data_info_dict and data_info_dict != 0: + if not data_info_dict or not self.data[i]: continue info_representation = ','.join([f"{key}=\"{value}\"" for (key, value) in data_info_dict.items()]) -- cgit v1.2.3