fix: do nothing on empty valueList

don't write `"**delvals."`, if nothing to delete.
This commit is contained in:
Корней Гедерт 2024-08-16 15:48:51 +04:00
parent 460b5288d4
commit 23a7a395fb

View File

@ -153,6 +153,11 @@ void cleanUpListInRegistry(AbstractRegistrySource &source, const std::string &ke
bool writeListIntoRegistry(AbstractRegistrySource &source, QMap<std::string, QString> valueList, const std::string &key, bool explicitValue, bool expandable, std::string &prefix)
{
if (valueList.empty())
{
return true;
}
// https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2008-r2-and-2008/cc770327(v=ws.10)
// true represents expandable string type (REG_EXPAND_SZ) and false represents string type (REG_SZ)
auto type = expandable ? REG_EXPAND_SZ : REG_SZ;