From 17a758f4dc7e41009ade34d44a4552c428aace4d Mon Sep 17 00:00:00 2001 From: Loren Eteval Date: Tue, 4 Feb 2025 22:15:56 +0800 Subject: [PATCH] Fix input when xhttp extra is empty Signed-off-by: Loren Eteval --- Furious/Widget/GuiVTransport.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Furious/Widget/GuiVTransport.py b/Furious/Widget/GuiVTransport.py index 67bf0b6..2bed3e8 100644 --- a/Furious/Widget/GuiVTransport.py +++ b/Furious/Widget/GuiVTransport.py @@ -837,7 +837,10 @@ class GuiVTransportItemExtraXHttp(GuiEditorItemTextInput): xhttpObject = streamSettings['xhttpSettings'] try: - oldExtra = UJSONEncoder.encode(xhttpObject.get('extra', '')) + if xhttpObject.get('extra', ''): + oldExtra = UJSONEncoder.encode(xhttpObject.get('extra', '')) + else: + oldExtra = '' except Exception: # Any non-exit exceptions @@ -872,7 +875,10 @@ class GuiVTransportItemExtraXHttp(GuiEditorItemTextInput): try: xhttpObject = getXrayProxyOutboundStream(config)['xhttpSettings'] - self.setText(UJSONEncoder.encode(xhttpObject.get('extra', ''))) + if xhttpObject.get('extra', ''): + self.setText(UJSONEncoder.encode(xhttpObject.get('extra', ''))) + else: + self.setText('') except Exception: # Any non-exit exceptions