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:
mateo-berri 2026-05-20 23:00:13 +00:00
parent e84fcdd471
commit 6e316ff27d
No known key found for this signature in database

View file

@ -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);
}
}}
/>