summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMikaƫl Capelle <capelle.mikael@gmail.com>2021-03-01 19:21:06 +0100
committerGitHub <noreply@github.com>2021-03-01 19:21:06 +0100
commitd436fe8cb39fd69ff7d37874c1c12dbb18e5c1cb (patch)
tree5bbaeb3731077e69353925ae18e6d67950a90ce7 /src
parent2b86a14c8644eac8ca6eddcb6be9d96d01b7ff68 (diff)
parent75e90f2f3fc74ba5bb1d4401ed16017c8769e578 (diff)
Merge pull request #1442 from Holt59/fix-createempty-mod
Fix priority for 'Create Empty Mod'.
Diffstat (limited to 'src')
-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);