From 8c5d3a8219f01296868ba8cfc8549e18e9cc136e Mon Sep 17 00:00:00 2001 From: zs-yg <3972006562@qq.com> Date: Sun, 23 Nov 2025 09:50:39 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E8=AD=A6=E5=91=8A=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Tools/server_management/ScriptGenerator.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Tools/server_management/ScriptGenerator.cs b/Tools/server_management/ScriptGenerator.cs index 6a82a62..b6a1dec 100644 --- a/Tools/server_management/ScriptGenerator.cs +++ b/Tools/server_management/ScriptGenerator.cs @@ -51,14 +51,18 @@ namespace MCSJ.Tools.ServerManagement // 解析JRE配置 var jreVersions = new Dictionary>(); - string currentVersion = null; + string currentVersion = string.Empty; foreach (var line in File.ReadAllLines(jreConfigPath)) { if (line.StartsWith("[") && line.EndsWith("]")) { - currentVersion = line.Trim('[', ']'); - jreVersions[currentVersion] = new Dictionary(); + var version = line.Trim('[', ']'); + currentVersion = version ?? string.Empty; + if (currentVersion != null!) + { + jreVersions[currentVersion] = new Dictionary(); + } } else if (line.Contains("=") && currentVersion != null) {