From 8e01b613626af8d0b136862e04431a2c305104fc Mon Sep 17 00:00:00 2001 From: gengjiawen Date: Sat, 10 Oct 2026 17:12:50 +0800 Subject: [PATCH] fix(clash): ignore null up/down in hysteria2 proxies A Clash hysteria2 proxy with `up: null` / `down: null` (or `~`) passed the IsDefined() check, and the fallback `as()` turned the null node into the string "null". Surge output then got `download-bandwidth=null`, Clash output `up: "null"`, and sing-box failed with a 500 from std::stoi("null"). --- src/parser/subparser.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/parser/subparser.cpp b/src/parser/subparser.cpp index 3e2f61c..7973de2 100644 --- a/src/parser/subparser.cpp +++ b/src/parser/subparser.cpp @@ -1648,7 +1648,7 @@ void explodeClash(Node yamlnode, std::vector &nodes) { singleproxy["password"] >>= password; if (password.empty()) singleproxy["auth"] >>= password; - if (singleproxy["up"].IsDefined()) { + if (singleproxy["up"].IsDefined() && !singleproxy["up"].IsNull()) { singleproxy["up"] >>= up; if (up.empty()) { try { @@ -1657,7 +1657,7 @@ void explodeClash(Node yamlnode, std::vector &nodes) { } } } - if (singleproxy["down"].IsDefined()) { + if (singleproxy["down"].IsDefined() && !singleproxy["down"].IsNull()) { singleproxy["down"] >>= down; if (down.empty()) { try {