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
@ -2131,6 +2131,10 @@ void MainWindow::on_actionCreateInstanceShortcut_triggered()
|
|||||||
}
|
}
|
||||||
|
|
||||||
auto icon = APPLICATION->icons()->icon(m_selectedInstance->iconKey());
|
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");
|
QString iconPath = FS::PathCombine(m_selectedInstance->instanceRoot(), "icon.png");
|
||||||
|
|
||||||
@ -2162,6 +2166,10 @@ void MainWindow::on_actionCreateInstanceShortcut_triggered()
|
|||||||
}
|
}
|
||||||
#elif defined(Q_OS_WIN)
|
#elif defined(Q_OS_WIN)
|
||||||
auto icon = APPLICATION->icons()->icon(m_selectedInstance->iconKey());
|
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");
|
QString iconPath = FS::PathCombine(m_selectedInstance->instanceRoot(), "icon.ico");
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user