Skip to content

Commit

Permalink
Database: Fix crash on actor faceset or charset selection
Browse files Browse the repository at this point in the history
If the faceset selection or charset selection had been called while
no actor was selected, the editor crashed. This is fixed now.
  • Loading branch information
rueter37 committed Dec 7, 2021
1 parent d7b5047 commit db36fd8
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/ui/database/actor_widget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,10 @@ void ActorWidget::resizeEvent(QResizeEvent *event)
}

void ActorWidget::faceSetClicked() {
if (!m_current) {
return;
}

auto* widget = new PickerFacesetWidget(m_current->face_index, this);
PickerDialog dialog(m_project, FileFinder::FileType::Image, widget, this);
QObject::connect(&dialog, &PickerDialog::fileSelected, [&](const QString& baseName) {
Expand All @@ -365,6 +369,10 @@ void ActorWidget::faceSetClicked() {
}

void ActorWidget::charSetClicked() {
if (!m_current) {
return;
}

auto* widget = new PickerCharsetWidget(m_current->character_index, this);
PickerDialog dialog(m_project, FileFinder::FileType::Image, widget, this);
QObject::connect(&dialog, &PickerDialog::fileSelected, [&](const QString& baseName) {
Expand Down

0 comments on commit db36fd8

Please sign in to comment.