Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2430)

Unified Diff: chrome/browser/ui/webui/options/chromeos/internet_options_handler.cc

Issue 470433002: Fix segfault when getting network details. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: dcheck Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/options/chromeos/internet_options_handler.cc
diff --git a/chrome/browser/ui/webui/options/chromeos/internet_options_handler.cc b/chrome/browser/ui/webui/options/chromeos/internet_options_handler.cc
index eb8fa9dec5ed9422a50843fd269e90ec7499d613..c4c8e95f2931efb44c9e65ae3dcc5b18710ae516 100644
--- a/chrome/browser/ui/webui/options/chromeos/internet_options_handler.cc
+++ b/chrome/browser/ui/webui/options/chromeos/internet_options_handler.cc
@@ -1374,13 +1374,17 @@ void InternetOptionsHandler::PopulateDictionaryDetailsCallback(
scoped_ptr<base::Value> auto_connect_value(
new base::FundamentalValue(auto_connect));
::onc::ONCSource auto_connect_onc_source = onc_source;
+
+ DCHECK_EQ(onc == NULL, onc_source == ::onc::ONC_SOURCE_NONE);
bool auto_connect_recommended =
auto_connect_onc_source != ::onc::ONC_SOURCE_NONE &&
onc::IsRecommendedValue(onc, onc_path_to_auto_connect);
- // |auto_connect_default_value| will contain either a recommended value
- // if |auto_connect_recommended| is true, or an enforced value otherwise.
+ // If a policy exists, |auto_connect_default_value| will contain either a
+ // recommended value (if |auto_connect_recommended| is true) or an enforced
+ // value (if |auto_connect_recommended| is false).
const base::Value* auto_connect_default_value = NULL;
- onc->Get(onc_path_to_auto_connect, &auto_connect_default_value);
+ if (onc)
+ onc->Get(onc_path_to_auto_connect, &auto_connect_default_value);
// Autoconnect can be controlled by the GlobalNetworkConfiguration of the
// ONC policy.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698