diff options
| author | cirakg <cirakg@cirakg.xyz> | 2026-11-03 00:31:11 +0100 |
|---|---|---|
| committer | cirakg <cirakg@cirakg.xyz> | 2026-11-03 00:31:11 +0100 |
| commit | c85a2c2d021e5337cf27ebd91a0f1e3d9f628de3 (patch) | |
| tree | 7e48118157f01fcb2d6540985570ae5df67a3ea8 /src/qt_common/util/game.cpp | |
| parent | 172aeaa0449d5618cff5753073a5c1741d619689 (diff) | |
| parent | 0f9760e5ccfd336130f194c2564849052acde591 (diff) | |
Merge upstream Djihads80/Eglantine nx2 into nx2
Diffstat (limited to 'src/qt_common/util/game.cpp')
| -rw-r--r-- | src/qt_common/util/game.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/qt_common/util/game.cpp b/src/qt_common/util/game.cpp index ddbe979765..ba669c3acf 100644 --- a/src/qt_common/util/game.cpp +++ b/src/qt_common/util/game.cpp @@ -430,8 +430,10 @@ void CreateShortcut(const std::string& game_path, const u64 program_id, game_title = fmt::format("{:016X}", program_id); if (control.first != nullptr) { game_title = control.first->GetApplicationName(); - } else { + } else if (loader != nullptr) { loader->ReadTitle(game_title); + } else { + LOG_WARNING(Frontend, "Could not load game title from {:s}", game_path); } } @@ -448,7 +450,8 @@ void CreateShortcut(const std::string& game_path, const u64 program_id, std::vector<u8> icon_image_file{}; if (control.second != nullptr) { icon_image_file = control.second->ReadAllBytes(); - } else if (loader->ReadIcon(icon_image_file) != Loader::ResultStatus::Success) { + } else if (loader == nullptr || + loader->ReadIcon(icon_image_file) != Loader::ResultStatus::Success) { LOG_WARNING(Frontend, "Could not read icon from {:s}", game_path); } @@ -535,6 +538,10 @@ void CreateHomeMenuShortcut(ShortcutTarget target) { } bool SaveIconToFile(const std::filesystem::path& icon_path, const QImage& image) { + if (image.isNull()) { + return false; + } + #if defined(WIN32) #pragma pack(push, 2) struct IconDir { |
