mirror of
https://github.com/MultiMC/MultiMC5.git
synced 2024-12-28 15:18:21 +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,13 +46,17 @@ CreateShortcutDialog::CreateShortcutDialog(QWidget *parent, InstancePtr instance
|
||||
// TODO: check if version is affected by crashing when joining servers on launch, ideally in meta
|
||||
|
||||
auto mcInstance = std::dynamic_pointer_cast<MinecraftInstance>(instance);
|
||||
mcInstance->getPackProfile()->reload(Net::Mode::Online);
|
||||
if (mcInstance && mcInstance->getPackProfile()->getComponent("net.minecraft")->getReleaseDateTime() >= g_VersionFilterData.quickPlayBeginsDate)
|
||||
if (mcInstance)
|
||||
{
|
||||
mcInstance->worldList()->update();
|
||||
for (const auto &world : mcInstance->worldList()->allWorlds())
|
||||
mcInstance->getPackProfile()->reload(Net::Mode::Online);
|
||||
|
||||
if (mcInstance->getPackProfile()->getComponent("net.minecraft")->getReleaseDateTime() >= g_VersionFilterData.quickPlayBeginsDate)
|
||||
{
|
||||
ui->joinSingleplayer->addItem(world.folderName());
|
||||
mcInstance->worldList()->update();
|
||||
for (const auto &world : mcInstance->worldList()->allWorlds())
|
||||
{
|
||||
ui->joinSingleplayer->addItem(world.folderName());
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user