Fix input when xhttp extra is empty

Signed-off-by: Loren Eteval <loren.eteval@proton.me>
This commit is contained in:
Loren Eteval
2025-02-04 22:15:56 +08:00
parent 0676974e62
commit 17a758f4dc
+8 -2
View File
@@ -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