Skip empty tool calls returned by gpt-5 on OpenRouter Fixes #4370
| @@ -724,7 +724,7 @@ export class ToolManager { | |||
| 724 | } | 724 | } |
| 725 | 725 | ||
| 726 | for (const toolCall of toolCalls) { | 726 | for (const toolCall of toolCalls) { |
| 727 | if (typeof toolCall.function !== 'object') { | 727 | if (!toolCall || !toolCall.function || typeof toolCall.function !== 'object') { |
| 728 | continue; | 728 | continue; |
| 729 | } | 729 | } |
| 730 | 730 | ||