From c7831fd69784e534f8f10641bedb03bef39020eb Mon Sep 17 00:00:00 2001 From: Trial97 Date: Fri, 31 Jan 2025 22:03:57 +0200 Subject: [PATCH] fix add resource with no instance Signed-off-by: Trial97 (cherry picked from commit c5efe081b4ff9ec81b882e6deabcbfc5be269329) --- launcher/ui/MainWindow.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/launcher/ui/MainWindow.cpp b/launcher/ui/MainWindow.cpp index 09c47b609..fa920c749 100644 --- a/launcher/ui/MainWindow.cpp +++ b/launcher/ui/MainWindow.cpp @@ -1027,6 +1027,14 @@ void MainWindow::processURLs(QList urls) continue; } + if (APPLICATION->instances()->count() <= 0) { + CustomMessageBox::selectable(this, tr("No instance!"), + tr("No instance available to add the resource to.\nPlease create a new instance before " + "attempting to install this resource again."), + QMessageBox::Critical) + ->show(); + continue; + } ImportResourceDialog dlg(localFileName, type, this); if (dlg.exec() != QDialog::Accepted)