mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-01-16 15:35:31 +01:00
🛡️ fix: Add Null Checks to Parameter Settings to Prevent Undefined Access (#9108)
Fixes "Cannot read properties of undefined (reading 'key')" error in parameter panels by filtering out null/undefined values before mapping operations. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
parent
b9bc3123d6
commit
beff848a3f
2 changed files with 9 additions and 7 deletions
|
|
@ -79,9 +79,9 @@ export default function ModelPanel({
|
|||
agentParamSettings[combinedKey] ?? agentParamSettings[overriddenEndpointKey] ?? [];
|
||||
const overriddenParams = endpointsConfig[provider]?.customParams?.paramDefinitions ?? [];
|
||||
const overriddenParamsMap = keyBy(overriddenParams, 'key');
|
||||
return defaultParams.map(
|
||||
(param) => (overriddenParamsMap[param.key] as SettingDefinition) ?? param,
|
||||
);
|
||||
return defaultParams
|
||||
.filter((param) => param != null)
|
||||
.map((param) => (overriddenParamsMap[param.key] as SettingDefinition) ?? param);
|
||||
}, [endpointType, endpointsConfig, model, provider]);
|
||||
|
||||
const setOption = (optionKey: keyof t.AgentModelParameters) => (value: t.AgentParameterValue) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue