mirror of
https://github.com/MultiMC/MultiMC5.git
synced 2025-01-16 22:20:16 +00:00
NOISSUE Only reload the pack profile if the cast to MinecraftInstance was successful
Prevents a potential segfault if the instance is not a MinecraftInstance
This commit is contained in:
parent
29c78b56fc
commit
d6dabfa67d
@ -46,8 +46,11 @@ CreateShortcutDialog::CreateShortcutDialog(QWidget *parent, InstancePtr instance
|
|||||||
// TODO: check if version is affected by crashing when joining servers on launch, ideally in meta
|
// TODO: check if version is affected by crashing when joining servers on launch, ideally in meta
|
||||||
|
|
||||||
auto mcInstance = std::dynamic_pointer_cast<MinecraftInstance>(instance);
|
auto mcInstance = std::dynamic_pointer_cast<MinecraftInstance>(instance);
|
||||||
|
if (mcInstance)
|
||||||
|
{
|
||||||
mcInstance->getPackProfile()->reload(Net::Mode::Online);
|
mcInstance->getPackProfile()->reload(Net::Mode::Online);
|
||||||
if (mcInstance && mcInstance->getPackProfile()->getComponent("net.minecraft")->getReleaseDateTime() >= g_VersionFilterData.quickPlayBeginsDate)
|
|
||||||
|
if (mcInstance->getPackProfile()->getComponent("net.minecraft")->getReleaseDateTime() >= g_VersionFilterData.quickPlayBeginsDate)
|
||||||
{
|
{
|
||||||
mcInstance->worldList()->update();
|
mcInstance->worldList()->update();
|
||||||
for (const auto &world : mcInstance->worldList()->allWorlds())
|
for (const auto &world : mcInstance->worldList()->allWorlds())
|
||||||
@ -55,6 +58,7 @@ CreateShortcutDialog::CreateShortcutDialog(QWidget *parent, InstancePtr instance
|
|||||||
ui->joinSingleplayer->addItem(world.folderName());
|
ui->joinSingleplayer->addItem(world.folderName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ui->joinServerRadioButton->setChecked(true);
|
ui->joinServerRadioButton->setChecked(true);
|
||||||
|
Loading…
Reference in New Issue
Block a user