From 4a55a192bb75b12856486105c2ad02c267f12dff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=9F=E5=AE=81?= Date: Thu, 5 Dec 2024 08:31:14 +0000 Subject: [PATCH] =?UTF-8?q?[Fix]=20=E4=BF=AE=E5=A4=8Drepo/migrate=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E6=8A=A5=E9=94=99=20Uncaught=20TypeError:=20Cannot=20?= =?UTF-8?q?read=20properties=20of=20undefined=20(reading=20'match')=20*=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8Drepo/migrate=E9=A1=B5=E9=9D=A2=E6=8A=A5?= =?UTF-8?q?=E9=94=99repo-template.js:22=20Uncaught=20TypeError:=20Cannot?= =?UTF-8?q?=20read=20=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web_src/js/features/repo-template.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/web_src/js/features/repo-template.js b/web_src/js/features/repo-template.js index 9c0579f769..507b21219e 100644 --- a/web_src/js/features/repo-template.js +++ b/web_src/js/features/repo-template.js @@ -98,9 +98,10 @@ export function initRepoTemplateSearch() { showElem($repoTemplateArea); } }; - $gitURLTemplate.on('change', checkGitURLTemplate); - checkGitURLTemplate(); - + if($gitURLTemplate.length){ + $gitURLTemplate.on('change', checkGitURLTemplate); + checkGitURLTemplate(); + } const checkDevStarTemplate = function () { if ($devstarTemplate.val() !== '' && $devstarTemplate.val() !== '0') { @@ -121,7 +122,9 @@ export function initRepoTemplateSearch() { showElem($nonTemplate); } }; - $devstarTemplate.on('change', checkDevStarTemplate); + if($devstarTemplate.length){ + $devstarTemplate.on('change', checkDevStarTemplate); + } const initDevStarTemplateSearch = function () { $('#devstar_template_search')