{"record":{"id":"5bd23aa37d164903","repo":"babalae/better-genshin-impact","slug":"error-5bd23a","errorCode":null,"errorMessage":"配置好感队时必须配置战斗队伍","messagePattern":"配置好感队时必须配置战斗队伍","errorType":"validation","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"BetterGenshinImpact/GameTask/AutoLeyLineOutcrop/AutoLeyLineOutcropTask.cs","lineNumber":196,"sourceCode":"\n        if (string.IsNullOrWhiteSpace(_taskParam.LeyLineOutcropType))\n        {\n            throw new Exception(\"地脉花类型未选择\");\n        }\n\n        if (_taskParam.LeyLineOutcropType != \"启示之花\" && _taskParam.LeyLineOutcropType != \"藏金之花\")\n        {\n            throw new Exception(\"地脉花类型无效，请重新选择\");\n        }\n\n        if (string.IsNullOrWhiteSpace(_taskParam.Country))\n        {\n            throw new Exception(\"国家未配置\");\n        }\n\n        if (!string.IsNullOrWhiteSpace(_taskParam.FriendshipTeam) && string.IsNullOrWhiteSpace(_taskParam.Team))\n        {\n            throw new Exception(\"配置好感队时必须配置战斗队伍\");\n        }\n\n        if (_taskParam.Count < 1)\n        {\n            _taskParam.Count = 1;\n        }\n\n        if (string.IsNullOrWhiteSpace(_taskParam.FightConfig.StrategyName) && _taskParam.Timeout > 0)\n        {\n            _taskParam.FightConfig.Timeout = _taskParam.Timeout;\n        }\n\n        if (_taskParam.FightConfig.Timeout <= 0)\n        {\n            _taskParam.FightConfig.Timeout = _taskParam.Timeout > 0 ? _taskParam.Timeout : 120;\n        }\n        else\n        {","sourceCodeStart":178,"sourceCodeEnd":214,"githubUrl":"https://github.com/babalae/better-genshin-impact/blob/a7cb36712dcb409be610257d877fcea3597e9d6b/BetterGenshinImpact/GameTask/AutoLeyLineOutcrop/AutoLeyLineOutcropTask.cs#L178-L214","documentation":"Thrown by ValidateSettings when FriendshipTeam is set (non-whitespace) but Team is empty/whitespace. The friendship team feature requires the automation to first run combat with a 'combat team' and then switch to a designated 'friendship team' to claim the reward (so friendship XP goes to specific characters). Without a combat team configured, the friendship-team switching logic has no team to switch back to after the reward, making the feature unsafe to run.","triggerScenarios":"A user configured a friendship team name (FriendshipTeam) but left the main combat team (Team) empty. This is an invalid combination because the task needs to switch between the two.","commonSituations":"User filled in the friendship-team field but forgot to set the combat team in the UI; a configuration was partially edited; the friendship feature was enabled without understanding the two-team requirement.","solutions":["Set the Team (combat team) field in the configuration whenever FriendshipTeam is used.","Alternatively, clear the FriendshipTeam field if friendship XP routing is not needed.","Verify both fields are populated correctly in the ley line task settings UI."],"exampleFix":"// before\ntaskParam.FriendshipTeam = \"好感队1\";\ntaskParam.Team = \"\"; // missing combat team\n\n// after\ntaskParam.FriendshipTeam = \"好感队1\";\ntaskParam.Team = \"战斗队1\";","handlingStrategy":"validation","validationCode":"// Before starting, validate the friendship team constraint\nif (!string.IsNullOrWhiteSpace(taskParam.FriendshipTeam)\n    && string.IsNullOrWhiteSpace(taskParam.Team))\n{\n    Logger.LogError(\"配置好感队时必须同时配置战斗队伍\");\n    return;\n}","typeGuard":"public static bool IsValidTeamConfig(AutoLeyLineOutcropParam param)\n{\n    return string.IsNullOrWhiteSpace(param.FriendshipTeam)\n        || !string.IsNullOrWhiteSpace(param.Team);\n}","tryCatchPattern":null,"preventionTips":["When using a friendship team, always configure a combat team as well.","Add UI-side validation that requires Team when FriendshipTeam is filled.","Clear FriendshipTeam if friendship XP routing is not needed."],"tags":["ley-line","validation","configuration","team","friendship"],"backgroundTag":null,"analyzedSha":"a7cb36712dcb409be610257d877fcea3597e9d6b","analyzedAt":"2026-08-13T16:44:57.548Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}