diff options
| author | Mikaël Capelle <capelle.mikael@gmail.com> | 2021-02-27 10:36:17 +0100 |
|---|---|---|
| committer | Mikaël Capelle <capelle.mikael@gmail.com> | 2021-02-27 10:36:17 +0100 |
| commit | 75e90f2f3fc74ba5bb1d4401ed16017c8769e578 (patch) | |
| tree | 5bbaeb3731077e69353925ae18e6d67950a90ce7 /src | |
| parent | 2b86a14c8644eac8ca6eddcb6be9d96d01b7ff68 (diff) | |
Fix priority for 'Create Empty Mod'.
Diffstat (limited to 'src')
| -rw-r--r-- | src/modlistviewactions.cpp | 3 |
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); |
