diff options
| author | isanae <14251494+isanae@users.noreply.github.com> | 2019-05-27 20:03:40 -0400 |
|---|---|---|
| committer | isanae <14251494+isanae@users.noreply.github.com> | 2019-05-27 20:03:40 -0400 |
| commit | 3732d24e0d228eb1e00c32a9fdc8cb371f9be280 (patch) | |
| tree | 473e5fc28f329ee33083795f58b5ec336345160f | |
| parent | 622908ee20ae5d74bff6524ff7c8eb044e25238b (diff) | |
findFile() seems to return null in some cases and crash on the line below
this is a quick fix for this particular crash, there's probably something deeper to fix
| -rw-r--r-- | src/pluginlist.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/pluginlist.cpp b/src/pluginlist.cpp index ec9bdac3..2edb92f5 100644 --- a/src/pluginlist.cpp +++ b/src/pluginlist.cpp @@ -139,7 +139,7 @@ void PluginList::highlightPlugins(const QItemSelectionModel *selection, const MO if (plugins.size() > 0) {
for (auto plugin : plugins) {
MOShared::FileEntry::Ptr file = directoryEntry.findFile(plugin.toStdWString());
- if (file->getOrigin() != origin.getID()) {
+ if (file && file->getOrigin() != origin.getID()) {
const std::vector<std::pair<int, std::pair<std::wstring, int>>> alternatives = file->getAlternatives();
if (std::find_if(alternatives.begin(), alternatives.end(), [&](const std::pair<int, std::pair<std::wstring, int>>& element) { return element.first == origin.getID(); }) == alternatives.end())
continue;
|
