From 71700d2cb119934122dc7fc9f8ffae725cb2fce1 Mon Sep 17 00:00:00 2001 From: dteviot Date: Sun, 18 Jan 2015 11:55:58 +1300 Subject: [PATCH] Bugfix: OpenCS segfault when plug-in dependency not found. When a file that a plug-in depends on cannot be found, the OpenCS file dialog crashes. Similar problem exists in omwlauncher's "Data Files" dialog. --- components/contentselector/model/contentmodel.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/components/contentselector/model/contentmodel.cpp b/components/contentselector/model/contentmodel.cpp index 4a1a69169..3f1feac61 100644 --- a/components/contentselector/model/contentmodel.cpp +++ b/components/contentselector/model/contentmodel.cpp @@ -597,13 +597,16 @@ QList ContentSelectorModel::ContentModel:: { errors.append(LoadOrderError(LoadOrderError::ErrorCode_MissingDependency, dependentfileName)); } - if (!isChecked(dependentFile->filePath())) + else { - errors.append(LoadOrderError(LoadOrderError::ErrorCode_InactiveDependency, dependentfileName)); - } - if (row < indexFromItem(dependentFile).row()) - { - errors.append(LoadOrderError(LoadOrderError::ErrorCode_LoadOrder, dependentfileName)); + if (!isChecked(dependentFile->filePath())) + { + errors.append(LoadOrderError(LoadOrderError::ErrorCode_InactiveDependency, dependentfileName)); + } + if (row < indexFromItem(dependentFile).row()) + { + errors.append(LoadOrderError(LoadOrderError::ErrorCode_LoadOrder, dependentfileName)); + } } } return errors;