{"record":{"id":"57e6e0d736c115ff","repo":"babalae/better-genshin-impact","slug":"error-57e6e0","errorCode":null,"errorMessage":"节点数据解析失败","messagePattern":"节点数据解析失败","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"critical","filePath":"BetterGenshinImpact/GameTask/AutoLeyLineOutcrop/AutoLeyLineOutcropTask.cs","lineNumber":763,"sourceCode":"        return partyConfig;\n    }\n\n    private async Task<NodeData> LoadNodeData()\n    {\n        if (_nodeData != null)\n        {\n            return _nodeData;\n        }\n\n        var workDir = Global.Absolute(@\"GameTask\\AutoLeyLineOutcrop\");\n        var nodePath = Path.Combine(workDir, \"Assets\", \"LeyLineOutcropData.json\");\n        if (!File.Exists(nodePath))\n        {\n            throw new FileNotFoundException(\"LeyLineOutcropData.json 未找到\", nodePath);\n        }\n\n        var raw = JsonSerializer.Deserialize<RawNodeData>(File.ReadAllText(nodePath))\n                  ?? throw new Exception(\"节点数据解析失败\");\n        _nodeData = AdaptNodeData(raw);\n        return _nodeData;\n    }\n\n    private static NodeData AdaptNodeData(RawNodeData raw)\n    {\n        var nodes = new List<Node>();\n        foreach (var teleport in raw.Teleports)\n        {\n            nodes.Add(new Node\n            {\n                Id = teleport.Id,\n                Region = teleport.Region,\n                Position = teleport.Position,\n                Type = \"teleport\",\n                Next = new List<NodeRoute>(),\n                Prev = new List<int>()\n            });","sourceCodeStart":745,"sourceCodeEnd":781,"githubUrl":"https://github.com/babalae/better-genshin-impact/blob/a7cb36712dcb409be610257d877fcea3597e9d6b/BetterGenshinImpact/GameTask/AutoLeyLineOutcrop/AutoLeyLineOutcropTask.cs#L745-L781","documentation":"Thrown by AutoLeyLineOutcropTask.LoadNodeData when JsonSerializer.Deserialize<RawNodeData> on the bundled asset GameTask\\AutoLeyLineOutcrop\\Assets\\LeyLineOutcropData.json returns null. The null-coalescing throw converts a silent null into a hard failure, so the node graph for ley-line routing is unavailable.","triggerScenarios":"LoadNodeData() is called the first time (_nodeData is null). The JSON file exists (File.Exists passed) but its content deserializes to null — e.g. the file body is literally \"null\", empty, or whitespace so System.Text.Json yields null for the reference type.","commonSituations":"The shipped asset got truncated/emptied by a publish step, a merge conflict, or an editor save that wrote \"null\". A custom build dropped the file content while leaving the file present.","solutions":["Open GameTask\\AutoLeyLineOutcrop\\Assets\\LeyLineOutcropData.json and confirm it is valid JSON with a non-null object root matching RawNodeData (Teleports, Blossoms, Edges, Indexes).","Restore the asset from source control if it was corrupted or emptied.","Ensure the build/publish pipeline copies the asset with full content into the output directory (check the .csproj CopyToOutputDirectory / None include for this file)."],"exampleFix":"// before\nvar raw = JsonSerializer.Deserialize<RawNodeData>(File.ReadAllText(nodePath))\n          ?? throw new Exception(\"节点数据解析失败\");\n\n// after — surface the actual problem instead of an opaque null\nvar nodeText = File.ReadAllText(nodePath);\nif (string.IsNullOrWhiteSpace(nodeText) || nodeText.Trim() == \"null\")\n{\n    throw new InvalidOperationException($\"LeyLineOutcropData.json 内容无效或为空: {nodePath}\");\n}\nvar raw = JsonSerializer.Deserialize<RawNodeData>(nodeText)\n          ?? throw new InvalidOperationException($\"LeyLineOutcropData.json 反序列化结果为 null: {nodePath}\");","handlingStrategy":"validation","validationCode":"var nodePath = Path.Combine(Global.Absolute(\"GameTask\\\\AutoLeyLineOutcrop\"), \"Assets\", \"LeyLineOutcropData.json\");\nif (!File.Exists(nodePath)) throw new FileNotFoundException(\"缺少地脉节点数据资产\", nodePath);\nvar text = File.ReadAllText(nodePath);\nif (string.IsNullOrWhiteSpace(text) || text.Trim() == \"null\")\n{\n    throw new InvalidOperationException($\"LeyLineOutcropData.json 内容无效: {nodePath}\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Add a CI/build step that validates every bundled JSON asset deserializes to a non-null object.","Mark LeyLineOutcropData.json as CopyToOutputDirectory and assert it is non-empty in the publish output.","Treat a null deserialize result as a data-integrity bug, not a runtime path."],"tags":["json","deserialization","asset","config","ley-line"],"backgroundTag":null,"analyzedSha":"a7cb36712dcb409be610257d877fcea3597e9d6b","analyzedAt":"2026-08-13T16:44:57.548Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}