Merge pull request #2954 from Trial97/skin_warn

do not try to import skin if path is empty
This commit is contained in:
Alexandru Ionut Tripon 2024-10-22 00:14:16 +03:00 committed by GitHub
commit a43ebefc97
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -139,6 +139,9 @@ void SkinManageDialog::on_fileBtn_clicked()
{
auto filter = QMimeDatabase().mimeTypeForName("image/png").filterString();
QString raw_path = QFileDialog::getOpenFileName(this, tr("Select Skin Texture"), QString(), filter);
if (raw_path.isNull()) {
return;
}
auto message = m_list.installSkin(raw_path, {});
if (!message.isEmpty()) {
CustomMessageBox::selectable(this, tr("Selected file is not a valid skin"), message, QMessageBox::Critical)->show();