mirror of
https://github.com/loot/libloot.git
synced 2026-07-27 14:16:01 -07:00
More potential crash fixes.
This commit is contained in:
@@ -148,7 +148,12 @@ namespace boss {
|
||||
const std::string& condition) : _type(type), _content(content), ConditionStruct(condition) {}
|
||||
|
||||
bool Message::operator < (const Message& rhs) const {
|
||||
return boost::ilexicographical_compare(_content.front().Str(), rhs.Content().front().Str());
|
||||
if (!_content.empty() && !rhs.Content().empty())
|
||||
return boost::ilexicographical_compare(_content.front().Str(), rhs.Content().front().Str());
|
||||
else if (_content.empty())
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Message::operator == (const Message& rhs) const {
|
||||
@@ -392,8 +397,7 @@ namespace boss {
|
||||
}
|
||||
|
||||
Plugin Plugin::DiffMetadata(const Plugin& plugin) const {
|
||||
Plugin p(name);
|
||||
p.Priority(priority);
|
||||
Plugin p(*this);
|
||||
|
||||
//Compare this plugin against the given plugin.
|
||||
set<File> files = plugin.LoadAfter();
|
||||
|
||||
+8
-1
@@ -668,12 +668,16 @@ void Launcher::OnSortPlugins(wxCommandEvent& event) {
|
||||
BOOST_LOG_TRIVIAL(trace) << "Building list of edited plugins.";
|
||||
for (list<boss::Plugin>::iterator it=newPluginsList.begin(),endit=newPluginsList.end(); it != endit; ++it) {
|
||||
list<boss::Plugin>::const_iterator jt = find(plugins.begin(), plugins.end(), *it);
|
||||
|
||||
if (jt == plugins.end())
|
||||
continue;
|
||||
|
||||
boss::Plugin diff = it->DiffMetadata(*jt);
|
||||
|
||||
if (!diff.HasNameOnly())
|
||||
editedPlugins.push_back(diff);
|
||||
}
|
||||
plugins = newPluginsList;
|
||||
plugins.swap(newPluginsList);
|
||||
|
||||
if (!editedPlugins.empty()) {
|
||||
|
||||
@@ -1109,6 +1113,9 @@ std::list<boss::Plugin> LoadOrderPreview::GetLoadOrder() const {
|
||||
|
||||
list<boss::Plugin>::const_iterator it = find(_plugins.begin(), _plugins.end(), boss::Plugin(name));
|
||||
|
||||
if (it == _plugins.end())
|
||||
continue;
|
||||
|
||||
plugins.push_back(*it);
|
||||
|
||||
if (wasMovedUp) {
|
||||
|
||||
Reference in New Issue
Block a user