diff options
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); |
