From 9c95d1bfa21aaa16f2f1d1c68677f4f540cfaaef Mon Sep 17 00:00:00 2001 From: Uleat Date: Mon, 16 Sep 2019 20:24:58 -0400 Subject: [PATCH] Fix for bad RestoreRuleNotes() query (thanks mackal!) --- common/rulesys.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/rulesys.cpp b/common/rulesys.cpp index 094780be3..035cff07a 100644 --- a/common/rulesys.cpp +++ b/common/rulesys.cpp @@ -554,7 +554,7 @@ bool RuleManager::UpdateOrphanedRules(Database *db, bool quiet_update) bool RuleManager::RestoreRuleNotes(Database *db) { - std::string query("SELECT `ruleset_id`, `rule_name`, IFNULL(`notes`, '\\0')`notes` FROM `rule_values`"); + std::string query("SELECT `ruleset_id`, `rule_name`, `notes` FROM `rule_values`"); auto results = db->QueryDatabase(query); if (!results.Success()) { @@ -579,7 +579,7 @@ bool RuleManager::RestoreRuleNotes(Database *db) continue; } - if (rule.notes.compare(row[2]) == 0) { + if (row[2] != nullptr && rule.notes.compare(row[2]) == 0) { continue; }