From 75e90f2f3fc74ba5bb1d4401ed16017c8769e578 Mon Sep 17 00:00:00 2001 From: Mikaƫl Capelle Date: Sat, 27 Feb 2021 10:36:17 +0100 Subject: Fix priority for 'Create Empty Mod'. --- src/modlistviewactions.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/modlistviewactions.cpp') 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); -- cgit v1.3.1