{"record":{"id":"2d1ff086f97fec70","repo":"babalae/better-genshin-impact","slug":"error-2d1ff0","errorCode":null,"errorMessage":"自动地脉花任务参数不能为空","messagePattern":"自动地脉花任务参数不能为空","errorType":"validation","errorClass":"ArgumentNullException","httpStatus":null,"severity":"error","filePath":"BetterGenshinImpact/Core/Script/Dependence/Dispatcher.cs","lineNumber":414,"sourceCode":"        var combatScript = CombatScriptParser.ParseContext(script, validate: false, defaultAvatarName: avatarName);\n        if (combatScript.CombatCommands.Count == 0) return;\n\n        _logger.LogInformation(\"执行 {Text}\", \"简易策略脚本\");\n\n        await CombatScriptExecutor.ExecuteAsync(combatScript, cancellationToken, _logger);\n    }\n    \n    /// <summary>  \n    /// 运行自动地脉花任务\n    /// </summary>  \n    /// <param name=\"param\">自动地脉花任务参数</param>  \n    /// <param name=\"customCt\">自定义取消令牌</param>  \n    /// <returns></returns>  \n    public async Task RunAutoLeyLineOutcropTask(AutoLeyLineOutcropParam param, CancellationToken? customCt = null)  \n    {  \n        if (param == null)  \n        {  \n            throw new ArgumentNullException(nameof(param), \"自动地脉花任务参数不能为空\");  \n        }  \n  \n        CancellationToken cancellationToken = customCt ?? CancellationContext.Instance.Cts.Token;  \n        await new AutoLeyLineOutcropTask(param).Start(cancellationToken);  \n    }\n\n\n    /// <summary>  \n    /// 运行自动幽境危战任务\n    /// </summary>  \n    /// <param name=\"param\">自动幽境危战任务参数</param>  \n    /// <param name=\"customCt\">自定义取消令牌</param>  \n    /// <returns></returns>  \n    public async Task RunAutoStygianOnslaughtTask(AutoStygianOnslaughtParam param, CancellationToken? customCt = null)\n    {\n        if (param == null)\n        {\n            throw new ArgumentNullException(nameof(param), \"自动幽境危战任务参数不能为空\");","sourceCodeStart":396,"sourceCodeEnd":432,"githubUrl":"https://github.com/babalae/better-genshin-impact/blob/a7cb36712dcb409be610257d877fcea3597e9d6b/BetterGenshinImpact/Core/Script/Dependence/Dispatcher.cs#L396-L432","documentation":"ArgumentNullException thrown by RunAutoLeyLineOutcropTask at line 414 when the AutoLeyLineOutcropParam argument is null. This task automates ley line outcrops and needs the param for its configuration; a null param is rejected before constructing the task.","triggerScenarios":"JS calls `dispatcher.RunAutoLeyLineOutcropTask(null)` or passes an undefined variable.","commonSituations":"Author forgot to construct AutoLeyLineOutcropParam. Param built conditionally and the branch did not run.","solutions":["Construct AutoLeyLineOutcropParam with the required settings before calling.","Null-check in JS before invoking."],"exampleFix":"// before (JS)\ndispatcher.RunAutoLeyLineOutcropTask(param); // null -> throws\n\n// after (JS)\nconst llParam = new AutoLeyLineOutcropParam(/* settings */);\ndispatcher.RunAutoLeyLineOutcropTask(llParam);","handlingStrategy":"validation","validationCode":"// JS side\nif (!param) throw new Error('AutoLeyLineOutcropParam is required');\ndispatcher.RunAutoLeyLineOutcropTask(param);","typeGuard":"// JS\nfunction isAutoLeyLineParam(v) { return v != null && typeof v === 'object'; }","tryCatchPattern":null,"preventionTips":["Construct AutoLeyLineOutcropParam before calling.","Null-check params in JS wrappers."],"tags":["script","argument-null","auto-ley-line","dispatcher"],"backgroundTag":null,"analyzedSha":"a7cb36712dcb409be610257d877fcea3597e9d6b","analyzedAt":"2026-08-13T16:44:57.548Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}