{"record":{"id":"700d64a722db4a79","repo":"babalae/better-genshin-impact","slug":"error-700d64","errorCode":null,"errorMessage":"地脉花类型未选择","messagePattern":"地脉花类型未选择","errorType":"validation","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"BetterGenshinImpact/GameTask/AutoLeyLineOutcrop/AutoLeyLineOutcropTask.cs","lineNumber":181,"sourceCode":"        }\n    }\n\n    private void Initialize()\n    {\n        _systemInfo = TaskContext.Instance().SystemInfo;\n        _tpTask = new TpTask(_ct);\n        ValidateSettings();\n        LoadConfigData();\n        LoadRecognitionObjects();\n    }\n\n    private void ValidateSettings()\n    {\n        _taskParam.FightConfig ??= new AutoLeyLineOutcropFightConfig();\n\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)","sourceCodeStart":163,"sourceCodeEnd":199,"githubUrl":"https://github.com/babalae/better-genshin-impact/blob/a7cb36712dcb409be610257d877fcea3597e9d6b/BetterGenshinImpact/GameTask/AutoLeyLineOutcrop/AutoLeyLineOutcropTask.cs#L163-L199","documentation":"Thrown by AutoLeyLineOutcropTask.ValidateSettings when _taskParam.LeyLineOutcropType is null, empty, or whitespace. ValidateSettings runs during Initialize (called at the top of Start) and is the first validation gate. LeyLineOutcropType determines which ley line blossom variant ('启示之花' for blossoms of revelation, '藏金之花' for blossoms of wealth) the task will seek. Without it the task cannot select the correct map markers or template images.","triggerScenarios":"The task was started with an AutoLeyLineOutcropParam where LeyLineOutcropType was never set — typically when launched from a script, scheduler, or one-dragon mode that did not populate the field from the UI selection.","commonSituations":"User started the task without selecting a ley line type in the configuration UI; a JSON/script configuration omitted the LeyLineOutcropType field; the param was constructed programmatically with defaults and the type was not explicitly assigned.","solutions":["Select either '启示之花' or '藏金之花' in the ley line task configuration UI before starting.","If constructing AutoLeyLineOutcropParam programmatically, set taskParam.LeyLineOutcropType = \"启示之花\" or \"藏金之花\".","Validate the configuration file / script that feeds the param to ensure LeyLineOutcropType is present."],"exampleFix":"// before\nvar param = new AutoLeyLineOutcropParam();\n// LeyLineOutcropType never set\nvar task = new AutoLeyLineOutcropTask(param);\n\n// after\nvar param = new AutoLeyLineOutcropParam\n{\n    LeyLineOutcropType = \"启示之花\",\n    Country = \"蒙德\"\n};\nvar task = new AutoLeyLineOutcropTask(param);","handlingStrategy":"validation","validationCode":"// Before starting, validate the ley line type is set\nif (string.IsNullOrWhiteSpace(taskParam.LeyLineOutcropType))\n{\n    Logger.LogError(\"请选择地脉花类型（启示之花或藏金之花）\");\n    return;\n}","typeGuard":"public static bool HasValidLeyLineType(AutoLeyLineOutcropParam param)\n{\n    return !string.IsNullOrWhiteSpace(param.LeyLineOutcropType);\n}","tryCatchPattern":null,"preventionTips":["Always select a ley line type in the task configuration UI before starting.","If constructing params programmatically, set LeyLineOutcropType explicitly.","Add a UI-side validation that disables the start button until a type is selected."],"tags":["ley-line","validation","configuration","param"],"backgroundTag":null,"analyzedSha":"a7cb36712dcb409be610257d877fcea3597e9d6b","analyzedAt":"2026-08-13T16:44:57.548Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}