diff --git a/launcher/ui/MainWindow.cpp b/launcher/ui/MainWindow.cpp index 71a64043e..1bdcd3f68 100644 --- a/launcher/ui/MainWindow.cpp +++ b/launcher/ui/MainWindow.cpp @@ -937,6 +937,9 @@ void MainWindow::processURLs(QList urls) { // NOTE: This loop only processes one dropped file! for (auto& url : urls) { + if (url.isEmpty() || url.toString().trimmed().isEmpty()) + continue; + qDebug() << "Processing" << url; // The isLocalFile() check below doesn't work as intended without an explicit scheme. @@ -1116,6 +1119,11 @@ void MainWindow::processURLs(QList urls) auto localFileName = QDir::toNativeSeparators(local_url.toLocalFile()); QFileInfo localFileInfo(localFileName); + if (localFileName.isEmpty() || !localFileInfo.exists()) { + qDebug() << "Ignoring invalid path" << localFileName; + continue; + } + auto type = ResourceUtils::identify(localFileInfo); if (ModPlatform::ResourceTypeUtils::VALID_RESOURCES.count(type) == 0) { // probably instance/modpack