fix(cpn): Companion simulator would crash post add model (#2281)

This commit is contained in:
Neil Horne
2022-09-06 21:08:02 +10:00
committed by GitHub
parent aec0639e66
commit 58a6239ac5
+2
View File
@@ -756,6 +756,8 @@ int MdiChild::newModel(int modelIndex)
bool isNewModel = radioData.models[modelIndex].isEmpty(); bool isNewModel = radioData.models[modelIndex].isEmpty();
checkAndInitModel(modelIndex); checkAndInitModel(modelIndex);
radioData.fixModelFilenames();
// Only set the default model if we just added the first one. // Only set the default model if we just added the first one.
if (countUsedModels() == 1) { if (countUsedModels() == 1) {
radioData.setCurrentModel(modelIndex); radioData.setCurrentModel(modelIndex);