mirror of
https://github.com/claude-code-best/claude-code.git
synced 2026-06-15 12:55:51 +00:00
fix: prevent crash when DiscoverSkills receives undefined query via ExecuteExtraTool
searchSkills() called .trim() on query without null-guard. When DiscoverSkills is invoked through ExecuteExtraTool with missing description, query is undefined, causing 'Cannot read properties of undefined (reading trim)'. Fixed with optional chaining: !query.trim() → !query?.trim() Co-Authored-By: deepseek-v4-pro <deepseek-ai@claude-code-best.win>
This commit is contained in:
@@ -385,7 +385,7 @@ export function searchSkills(
|
|||||||
index: SkillIndexEntry[],
|
index: SkillIndexEntry[],
|
||||||
limit = 5,
|
limit = 5,
|
||||||
): SearchResult[] {
|
): SearchResult[] {
|
||||||
if (index.length === 0 || !query.trim()) return []
|
if (index.length === 0 || !query?.trim()) return []
|
||||||
|
|
||||||
const queryTokens = tokenizeAndStem(query)
|
const queryTokens = tokenizeAndStem(query)
|
||||||
if (queryTokens.length === 0) return []
|
if (queryTokens.length === 0) return []
|
||||||
|
|||||||
Reference in New Issue
Block a user