{"record":{"id":"40e4debb2e6b4adc","repo":"babalae/better-genshin-impact","slug":"error-40e4de","errorCode":null,"errorMessage":"没找到最近的七天神像","messagePattern":"没找到最近的七天神像","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"BetterGenshinImpact/GameTask/AutoTrackPath/TpTask.cs","lineNumber":354,"sourceCode":"    /// <param name=\"x\"></param>\n    /// <param name=\"y\"></param>\n    /// <returns></returns>\n    private GiTpPosition GetNearestGoddess(double x, double y)\n    {\n        GiTpPosition? nearestGiTpPosition = null;\n        double minDistance = double.MaxValue;\n        foreach (var (_, goddessPosition) in MapLazyAssets.Get().GoddessPositions)\n        {\n            var distance = Math.Sqrt(Math.Pow(goddessPosition.X - x, 2) + Math.Pow(goddessPosition.Y - y, 2));\n            if (distance < minDistance)\n            {\n                minDistance = distance;\n                nearestGiTpPosition = goddessPosition;\n            }\n        }\n\n        // 获取最近的神像位置\n        return nearestGiTpPosition ?? throw new InvalidOperationException(\"没找到最近的七天神像\");\n    }\n\n    /// <summary>\n    ///释放所有按键，并打开大地图界面\n    /// </summary>\n    /// <param name=\"retryCount\">重试次数</param>\n    public async Task OpenBigMapUi(int retryCount = 3, string? mapName = null)\n    {\n        for (var i = 0; i < retryCount; i++)\n        {\n            try\n            {\n                // 打开地图前释放所有按键\n                Simulation.ReleaseAllKey();\n                await Delay(GetTeleportOperationDelay(20), ct);\n                await CheckInBigMapUi(mapName);\n                return;\n            }","sourceCodeStart":336,"sourceCodeEnd":372,"githubUrl":"https://github.com/babalae/better-genshin-impact/blob/a7cb36712dcb409be610257d877fcea3597e9d6b/BetterGenshinImpact/GameTask/AutoTrackPath/TpTask.cs#L336-L372","documentation":"InvalidOperationException from GetNearestGoddess when the GoddessPositions dictionary (built from tp.json entries of Type==\"Goddess\") contains no entries, so nearestGiTpPosition stays null. This is a data/config error: the game's Statue of the Seven (七天神像) list is empty, so no nearest statue can be returned for teleport fallback.","triggerScenarios":"MapLazyAssets failed to populate _goddessPositions because tp.json is missing/corrupt/filtered so no Type==\"Goddess\" entries exist; the Lazy<MapLazyAssets> cache was built from a partially-loaded tp.json; tp.json deserialization dropped the Goddess entries due to a schema change.","commonSituations":"Corrupted or outdated GameTask/AutoTrackPath/Assets/tp.json; custom build that excluded the asset; new game version added new tp.json schema and old file has no Goddess entries; file read partially failed at startup.","solutions":["Restore the original GameTask/AutoTrackPath/Assets/tp.json from a known-good release.","Verify tp.json parses and contains entries with \"type\":\"Goddess\".","Clear the MapLazyAssets cache (restart the app) so the Lazy re-initializes from the corrected file.","Add a guard at MapLazyAssets construction to fail loudly with a clear message if GoddessPositions is empty."],"exampleFix":"// before\nreturn nearestGiTpPosition ?? throw new InvalidOperationException(\"没找到最近的七天神像\");\n\n// after: fail at load time with the real cause\nif (_goddessPositions.Count == 0)\n    throw new InvalidOperationException(\"tp.json 未包含任何 Goddess（七天神像）条目，请检查资源文件完整性。\");\n...\nreturn nearestGiTpPosition ?? throw new InvalidOperationException(\"没找到最近的七天神像\");","handlingStrategy":"validation","validationCode":"if (MapLazyAssets.Get().GoddessPositions.Count == 0)\n    return Result.Fail(\"tp.json 缺少七天神像数据，传送功能不可用\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate tp.json integrity and the Goddess count at startup.","Ship tp.json as a versioned asset and fail loudly if missing/empty.","Restart the app after replacing a corrupt tp.json so the Lazy cache rebuilds."],"tags":["teleport","goddess-statue","assets","tp-json","data"],"backgroundTag":null,"analyzedSha":"a7cb36712dcb409be610257d877fcea3597e9d6b","analyzedAt":"2026-08-13T16:44:57.548Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}