aboutsummaryrefslogtreecommitdiff
path: root/launcher/ui/pages/modplatform/technic/TechnicModel.cpp
diff options
context:
space:
mode:
authorflow <flowlnlnln@gmail.com>2022-06-24 20:09:44 -0300
committerflow <flowlnlnln@gmail.com>2022-07-03 12:44:19 -0300
commite5f6dc1b14a03b078b69be1c4c3c5819092604c3 (patch)
tree1ac686ae1ab8998fb5b55dfe03d5d4528923892c /launcher/ui/pages/modplatform/technic/TechnicModel.cpp
parent145da82cd8ca6856975eca175fdad74f6d6a0659 (diff)
downloadPrismLauncher-e5f6dc1b14a03b078b69be1c4c3c5819092604c3.tar.gz
PrismLauncher-e5f6dc1b14a03b078b69be1c4c3c5819092604c3.tar.bz2
PrismLauncher-e5f6dc1b14a03b078b69be1c4c3c5819092604c3.zip
fix: aborts when using a Qt build with assertions enabled
Preventing undefined behaviour hooray! :D Signed-off-by: flow <flowlnlnln@gmail.com>
Diffstat (limited to 'launcher/ui/pages/modplatform/technic/TechnicModel.cpp')
-rw-r--r--launcher/ui/pages/modplatform/technic/TechnicModel.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/launcher/ui/pages/modplatform/technic/TechnicModel.cpp b/launcher/ui/pages/modplatform/technic/TechnicModel.cpp
index 9c9d1e75..742f4f2a 100644
--- a/launcher/ui/pages/modplatform/technic/TechnicModel.cpp
+++ b/launcher/ui/pages/modplatform/technic/TechnicModel.cpp
@@ -217,6 +217,11 @@ void Technic::ListModel::searchRequestFinished()
return;
}
searchState = Finished;
+
+ // When you have a Qt build with assertions turned on, proceeding here will abort the application
+ if (newList.size() == 0)
+ return;
+
beginInsertRows(QModelIndex(), modpacks.size(), modpacks.size() + newList.size() - 1);
modpacks.append(newList);
endInsertRows();