Skip to content

Commit

Permalink
GUI: fix crash when no tab is selected
Browse files Browse the repository at this point in the history
  • Loading branch information
jdupak committed Jan 27, 2024
1 parent 152bd33 commit ae729e8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/gui/windows/editor/editordock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ EditorDock::EditorDock(QSharedPointer<QSettings> settings, QTabWidget *parent_ta
this, &EditorDock::currentChanged, parent_tabs,
[this, parent_tabs](int index) {
// Update parent title
if (count() == 0) return;
if (count() == 0 || index < 0) return;
auto *editor = get_tab(index)->get_editor();
QString title = QString("&Editor (%1)").arg(editor->title());
parent_tabs->setTabText(parent_tabs->indexOf(this), title);
Expand Down

0 comments on commit ae729e8

Please sign in to comment.