summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikaël Capelle <capelle.mikael@gmail.com>2021-02-27 10:36:17 +0100
committerMikaël Capelle <capelle.mikael@gmail.com>2021-02-27 10:36:17 +0100
commit75e90f2f3fc74ba5bb1d4401ed16017c8769e578 (patch)
tree5bbaeb3731077e69353925ae18e6d67950a90ce7
parent2b86a14c8644eac8ca6eddcb6be9d96d01b7ff68 (diff)
Fix priority for 'Create Empty Mod'.
-rw-r--r--src/modlistviewactions.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/modlistviewactions.cpp b/src/modlistviewactions.cpp
index c11f4ea8..acf765f6 100644
--- a/src/modlistviewactions.cpp
+++ b/src/modlistviewactions.cpp
@@ -145,9 +145,10 @@ void ModListViewActions::createEmptyMod(const QModelIndex& index) const
return;
}
+ // find the priority before refresh() otherwise the index might not be valid
+ const int newPriority = findInstallPriority(index);
m_core.refresh();
- const int newPriority = findInstallPriority(index);
const auto mIndex = ModInfo::getIndex(name);
if (newPriority >= 0) {
m_core.modList()->changeModPriority(mIndex, newPriority);