mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-12 23:01:41 +00:00
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.
This commit is contained in:
parent
e84fcdd471
commit
6e316ff27d
1 changed files with 3 additions and 2 deletions
|
|
@ -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);
|
||||
}
|
||||
}}
|
||||
/>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue