mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-17 17:00:15 +01:00
🔧 fix: Potential Null Values for Custom Config
This commit is contained in:
parent
299c484c7a
commit
97085073d2
2 changed files with 3 additions and 4 deletions
|
|
@ -29,8 +29,6 @@ router.get('/', async function (req, res) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const config = await getCustomConfig();
|
|
||||||
|
|
||||||
const isBirthday = () => {
|
const isBirthday = () => {
|
||||||
const today = new Date();
|
const today = new Date();
|
||||||
return today.getMonth() === 1 && today.getDate() === 11;
|
return today.getMonth() === 1 && today.getDate() === 11;
|
||||||
|
|
@ -102,7 +100,8 @@ router.get('/', async function (req, res) {
|
||||||
};
|
};
|
||||||
|
|
||||||
payload.mcpServers = {};
|
payload.mcpServers = {};
|
||||||
if (config.mcpServers) {
|
const config = await getCustomConfig();
|
||||||
|
if (config?.mcpServers != null) {
|
||||||
for (const serverName in config.mcpServers) {
|
for (const serverName in config.mcpServers) {
|
||||||
const serverConfig = config.mcpServers[serverName];
|
const serverConfig = config.mcpServers[serverName];
|
||||||
payload.mcpServers[serverName] = {
|
payload.mcpServers[serverName] = {
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,7 @@ const getCustomEndpointConfig = async (endpoint) => {
|
||||||
async function createGetMCPAuthMap() {
|
async function createGetMCPAuthMap() {
|
||||||
const customConfig = await getCustomConfig();
|
const customConfig = await getCustomConfig();
|
||||||
const mcpServers = customConfig?.mcpServers;
|
const mcpServers = customConfig?.mcpServers;
|
||||||
const hasCustomUserVars = Object.values(mcpServers).some((server) => server.customUserVars);
|
const hasCustomUserVars = Object.values(mcpServers ?? {}).some((server) => server.customUserVars);
|
||||||
if (!hasCustomUserVars) {
|
if (!hasCustomUserVars) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue