mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2026-07-02 11:26:59 +03:00
Windows, Linux: prevent segfault on missing icon
Signed-off-by: ADudeCalledLeo <7997354+Leo40Git@users.noreply.github.com>
This commit is contained in:
parent
acd50969e0
commit
5be8545edc
1 changed files with 10 additions and 2 deletions
|
|
@ -2131,7 +2131,11 @@ void MainWindow::on_actionCreateInstanceShortcut_triggered()
|
|||
}
|
||||
|
||||
auto icon = APPLICATION->icons()->icon(m_selectedInstance->iconKey());
|
||||
|
||||
if (icon == nullptr)
|
||||
{
|
||||
icon = APPLICATION->icons()->icon("grass");
|
||||
}
|
||||
|
||||
QString iconPath = FS::PathCombine(m_selectedInstance->instanceRoot(), "icon.png");
|
||||
|
||||
QFile iconFile(iconPath);
|
||||
|
|
@ -2162,7 +2166,11 @@ void MainWindow::on_actionCreateInstanceShortcut_triggered()
|
|||
}
|
||||
#elif defined(Q_OS_WIN)
|
||||
auto icon = APPLICATION->icons()->icon(m_selectedInstance->iconKey());
|
||||
|
||||
if (icon == nullptr)
|
||||
{
|
||||
icon = APPLICATION->icons()->icon("grass");
|
||||
}
|
||||
|
||||
QString iconPath = FS::PathCombine(m_selectedInstance->instanceRoot(), "icon.ico");
|
||||
|
||||
// part of fix for weird bug involving the window icon being replaced
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue