mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 01:28:27 +00:00
fix: guard .trim() calls on potentially undefined workspaceDir (#24875)
Change workspaceDir param type from string to string | undefined in resolvePluginSkillDirs and use nullish coalescing before .trim() to prevent TypeError when workspaceDir is undefined.
This commit is contained in:
@@ -12,10 +12,10 @@ import { loadPluginManifestRegistry } from "../../plugins/manifest-registry.js";
|
|||||||
const log = createSubsystemLogger("skills");
|
const log = createSubsystemLogger("skills");
|
||||||
|
|
||||||
export function resolvePluginSkillDirs(params: {
|
export function resolvePluginSkillDirs(params: {
|
||||||
workspaceDir: string;
|
workspaceDir: string | undefined;
|
||||||
config?: OpenClawConfig;
|
config?: OpenClawConfig;
|
||||||
}): string[] {
|
}): string[] {
|
||||||
const workspaceDir = params.workspaceDir.trim();
|
const workspaceDir = (params.workspaceDir ?? "").trim();
|
||||||
if (!workspaceDir) {
|
if (!workspaceDir) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user