Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: src/FilterEngine.cpp

Issue 29397596: Issue 5040 - fix saving of allowed_connection_type preference (Closed)
Patch Set: Created March 29, 2017, 10:57 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/prefs.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/FilterEngine.cpp
diff --git a/src/FilterEngine.cpp b/src/FilterEngine.cpp
index 5c1a495619c76e0b51a886b9116807789b135c9a..42b7b0b5a2e8a3960c46451b575d3b115c330115 100644
--- a/src/FilterEngine.cpp
+++ b/src/FilterEngine.cpp
@@ -485,13 +485,13 @@ void FilterEngine::RemoveFilterChangeCallback()
void FilterEngine::SetAllowedConnectionType(const std::string* value)
{
- SetPref("allowed_connection_type", value ? jsEngine->NewValue(*value) : nullptr);
+ SetPref("allowed_connection_type", value ? jsEngine->NewValue(*value) : jsEngine->NewValue(""));
}
std::unique_ptr<std::string> FilterEngine::GetAllowedConnectionType() const
{
auto prefValue = GetPref("allowed_connection_type");
- if (prefValue->IsUndefined())
+ if (prefValue->AsString().empty())
return nullptr;
return std::unique_ptr<std::string>(new std::string(prefValue->AsString()));
}
« no previous file with comments | « lib/prefs.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld