From acc0b89d5b98e3cb6ec42e234ac704323ee2de82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E8=89=AF?= <841369634@qq.com> Date: Tue, 16 Jun 2026 21:20:43 +0800 Subject: [PATCH] fix: Fix when `source_value` is null, the result of the `ge`, `gt`, `le` and `lt` comparators is incorrect --- apps/application/flow/compare/ge_compare.py | 3 +++ apps/application/flow/compare/gt_compare.py | 3 +++ apps/application/flow/compare/le_compare.py | 3 +++ apps/application/flow/compare/lt_compare.py | 3 +++ 4 files changed, 12 insertions(+) diff --git a/apps/application/flow/compare/ge_compare.py b/apps/application/flow/compare/ge_compare.py index bd85d0c3c52..e1cf2e7aac0 100644 --- a/apps/application/flow/compare/ge_compare.py +++ b/apps/application/flow/compare/ge_compare.py @@ -12,6 +12,9 @@ class GECompare(Compare): def compare(self, source_value, compare, target_value): + if source_value is None: + return target_value is None + try: return float(source_value) >= float(target_value) except Exception: diff --git a/apps/application/flow/compare/gt_compare.py b/apps/application/flow/compare/gt_compare.py index c83a1e765e0..fab86c4bc8c 100644 --- a/apps/application/flow/compare/gt_compare.py +++ b/apps/application/flow/compare/gt_compare.py @@ -12,6 +12,9 @@ class GTCompare(Compare): def compare(self, source_value, compare, target_value): + if source_value is None: + return False + try: return float(source_value) > float(target_value) except Exception: diff --git a/apps/application/flow/compare/le_compare.py b/apps/application/flow/compare/le_compare.py index 8b115d84b33..0ebdb394857 100644 --- a/apps/application/flow/compare/le_compare.py +++ b/apps/application/flow/compare/le_compare.py @@ -12,6 +12,9 @@ class LECompare(Compare): def compare(self, source_value, compare, target_value): + if source_value is None: + return target_value is None + try: return float(source_value) <= float(target_value) except Exception: diff --git a/apps/application/flow/compare/lt_compare.py b/apps/application/flow/compare/lt_compare.py index 6720af7f17a..ecf8d549bfd 100644 --- a/apps/application/flow/compare/lt_compare.py +++ b/apps/application/flow/compare/lt_compare.py @@ -12,6 +12,9 @@ class LTCompare(Compare): def compare(self, source_value, compare, target_value): + if source_value is None: + return False + try: return float(source_value) < float(target_value) except Exception: