From 6e316ff27d51d13a5689e61c79d54f97ed67ec11 Mon Sep 17 00:00:00 2001 From: mateo-berri <277851410+mateo-berri@users.noreply.github.com> Date: Wed, 20 May 2026 23:00:13 +0000 Subject: [PATCH] fix(ui): guard model_info access in pause Switch onChange handler Mirror the optional-chaining guard already applied to the isPausing check so a config-model row with a missing model_info cannot throw when the toggle's onChange fires. --- .../src/components/molecules/models/columns.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ui/litellm-dashboard/src/components/molecules/models/columns.tsx b/ui/litellm-dashboard/src/components/molecules/models/columns.tsx index 0a1a1118cc6..4563e9c80dd 100644 --- a/ui/litellm-dashboard/src/components/molecules/models/columns.tsx +++ b/ui/litellm-dashboard/src/components/molecules/models/columns.tsx @@ -435,8 +435,9 @@ export const columns = ( e.stopPropagation(); }} onChange={(nextChecked) => { - if (isPauseToggleable && onTogglePauseClick) { - void onTogglePauseClick(model.model_info.id, !nextChecked); + const modelId = model.model_info?.id; + if (isPauseToggleable && onTogglePauseClick && modelId) { + void onTogglePauseClick(modelId, !nextChecked); } }} />