Skip to content

Commit 3f2fd50

Browse files
Handle logic edge case
1 parent abe6a25 commit 3f2fd50

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

libs/mcp/tasks/src/lib/mcp-task-registry.class.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,14 @@ export class MCPTaskRegistry {
139139
taskFunction: IGlobalIndexedToken<GlobalFunctionToken>,
140140
taskStructure: IGlobalIndexedToken<GlobalStructureToken>,
141141
) {
142+
const match = TASK_REGEX.exec(taskStructure.meta.display);
143+
144+
if (match === null) {
145+
return;
146+
}
147+
142148
/** Get task display name */
143-
const taskDisplay = TASK_REGEX.exec(taskStructure.meta.display)[1];
149+
const taskDisplay = match[1];
144150

145151
/** Determine the type of task */
146152
const toolType = taskStructure.name.startsWith('envi') ? 'ENVI' : 'IDL';

0 commit comments

Comments
 (0)