From 9230f9374d12efc24ee2cea353cc56df63a20bc1 Mon Sep 17 00:00:00 2001 From: Toby Chui Date: Mon, 21 Jul 2025 20:10:55 +0800 Subject: [PATCH] Added null check on front-end - Added null check on TlsOption on front-end --- src/web/components/httprp.html | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/web/components/httprp.html b/src/web/components/httprp.html index e5fcc27..31556a1 100644 --- a/src/web/components/httprp.html +++ b/src/web/components/httprp.html @@ -1423,11 +1423,17 @@ /* ------------ TLS ------------ */ updateTlsResolveList(uuid); - editor.find(".Tls_EnableSNI").prop("checked", !subd.TlsOptions.DisableSNI); - - editor.find(".Tls_EnableLegacyCertificateMatching").prop("checked", !subd.TlsOptions.DisableLegacyCertificateMatching); - editor.find(".Tls_EnableAutoHTTPS").prop("checked", !!subd.TlsOptions.EnableAutoHTTPS); - + if (subd.TlsOptions){ + editor.find(".Tls_EnableSNI").prop("checked", !subd.TlsOptions.DisableSNI); + editor.find(".Tls_EnableLegacyCertificateMatching").prop("checked", !subd.TlsOptions.DisableLegacyCertificateMatching); + editor.find(".Tls_EnableAutoHTTPS").prop("checked", !!subd.TlsOptions.EnableAutoHTTPS); + }else{ + //Use default options + editor.find(".Tls_EnableSNI").prop("checked", true); + editor.find(".Tls_EnableLegacyCertificateMatching").prop("checked", true); + editor.find(".Tls_EnableAutoHTTPS").prop("checked", false); + } + editor.find(".Tls_EnableSNI").off("change").on("change", function() { saveTlsConfigs(uuid); });