diff --git a/DevTools/HackStudio/HackStudioWidget.cpp b/DevTools/HackStudio/HackStudioWidget.cpp index db926ef799..dd0ae546eb 100644 --- a/DevTools/HackStudio/HackStudioWidget.cpp +++ b/DevTools/HackStudio/HackStudioWidget.cpp @@ -459,13 +459,12 @@ NonnullRefPtr HackStudioWidget::create_remove_current_terminal_acti auto widget = m_action_tab_widget->active_widget(); if (!widget) return; - if (strcmp(widget->class_name(), "TerminalWrapper") != 0) + if (!is(widget)) return; - auto terminal = reinterpret_cast(widget); - if (!terminal->user_spawned()) + auto& terminal = *static_cast(widget); + if (!terminal.user_spawned()) return; - - m_action_tab_widget->remove_tab(*terminal); + m_action_tab_widget->remove_tab(terminal); update_actions(); }); }