From 3a08a8cf0725ed2332072a51a290a84869c22fe1 Mon Sep 17 00:00:00 2001 From: Oliver Hamlet Date: Mon, 19 Dec 2022 16:15:54 +0000 Subject: [PATCH] Fix null pointer dereference Fortunately the function is never actually called with a null pointer. --- src/api/sorting/plugin_sorting_data.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/api/sorting/plugin_sorting_data.cpp b/src/api/sorting/plugin_sorting_data.cpp index 850e09bd..51d5b644 100644 --- a/src/api/sorting/plugin_sorting_data.cpp +++ b/src/api/sorting/plugin_sorting_data.cpp @@ -108,9 +108,10 @@ PluginSortingData::PluginSortingData( std::string PluginSortingData::GetName() const { return plugin_->GetName(); } bool PluginSortingData::IsMaster() const { - return plugin_ != nullptr && plugin_->IsMaster() || - (plugin_->IsLightPlugin() && - !boost::iends_with(plugin_->GetName(), ".esp")); + return plugin_ != nullptr && + (plugin_->IsMaster() || + (plugin_->IsLightPlugin() && + !boost::iends_with(plugin_->GetName(), ".esp"))); } bool PluginSortingData::LoadsArchive() const {