{"record":{"id":"d54903498e01ea14","repo":"babalae/better-genshin-impact","slug":"error-d54903","errorCode":null,"errorMessage":"自动首领讨伐任务参数不能为空","messagePattern":"自动首领讨伐任务参数不能为空","errorType":"validation","errorClass":"ArgumentNullException","httpStatus":null,"severity":"error","filePath":"BetterGenshinImpact/Core/Script/Dependence/Dispatcher.cs","lineNumber":353,"sourceCode":"        {  \n            throw new ArgumentNullException(nameof(param), \"秘境任务参数不能为空\");  \n        }  \n  \n        CancellationToken cancellationToken = customCt ?? CancellationContext.Instance.Cts.Token;  \n        return await new AutoDomainTask(param).Start(cancellationToken);\n    }  \n\n    /// <summary>\n    /// 运行自动首领讨伐任务\n    /// </summary>\n    /// <param name=\"param\">自动首领讨伐任务参数</param>\n    /// <param name=\"customCt\">自定义取消令牌</param>\n    /// <returns></returns>\n    public async Task<Dictionary<string, int>> RunAutoBossTask(AutoBossParam 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        return await new AutoBossTask(param).Start(cancellationToken);\n    }\n\n    /// <summary>  \n    /// 运行自动战斗任务\n    /// </summary>  \n    /// <param name=\"param\">战斗任务参数</param>  \n    /// <param name=\"customCt\">自定义取消令牌</param>  \n    /// <returns></returns>  \n    public async Task RunAutoFightTask(AutoFightParam param, CancellationToken? customCt = null)  \n    {  \n        if (param == null)  \n        {  \n            throw new ArgumentNullException(nameof(param), \"战斗任务参数不能为空\");  \n        }  ","sourceCodeStart":335,"sourceCodeEnd":371,"githubUrl":"https://github.com/babalae/better-genshin-impact/blob/a7cb36712dcb409be610257d877fcea3597e9d6b/BetterGenshinImpact/Core/Script/Dependence/Dispatcher.cs#L335-L371","documentation":"ArgumentNullException thrown by RunAutoBossTask at line 353 when the AutoBossParam argument is null. Same pattern as the other RunXxxTask helpers: this entrypoint expects a ready param object carrying boss/strategy configuration.","triggerScenarios":"JS calls `dispatcher.RunAutoBossTask(null)` or passes an undefined variable.","commonSituations":"Author forgot to build AutoBossParam. Refactor left the param unset.","solutions":["Construct AutoBossParam with boss and strategy settings before calling.","Null-check in JS before invoking."],"exampleFix":"// before (JS)\ndispatcher.RunAutoBossTask(param); // null -> throws\n\n// after (JS)\nconst bossParam = new AutoBossParam(strategyPath);\ndispatcher.RunAutoBossTask(bossParam);","handlingStrategy":"validation","validationCode":"// JS side\nif (!param) throw new Error('AutoBossParam is required');\ndispatcher.RunAutoBossTask(param);","typeGuard":"// JS\nfunction isAutoBossParam(v) { return v != null && typeof v === 'object'; }","tryCatchPattern":null,"preventionTips":["Construct AutoBossParam before calling RunAutoBossTask.","Null-check params in JS wrappers."],"tags":["script","argument-null","auto-boss","dispatcher"],"backgroundTag":null,"analyzedSha":"a7cb36712dcb409be610257d877fcea3597e9d6b","analyzedAt":"2026-08-13T16:44:57.548Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}