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

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: 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..49c565573c220b994eb7e23b13ecd50b32f29587 100644
--- a/chrome/browser/ui/webui/options/chromeos/internet_options_handler.cc
+++ b/chrome/browser/ui/webui/options/chromeos/internet_options_handler.cc
@@ -1376,11 +1376,13 @@ void InternetOptionsHandler::PopulateDictionaryDetailsCallback(
::onc::ONCSource auto_connect_onc_source = onc_source;
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.
+ onc && onc::IsRecommendedValue(onc, onc_path_to_auto_connect);
pneubeck (no reviews) 2014/08/13 02:37:14 optional nit: strictly, this 'onc' condition shoul
michaelpg 2014/08/13 02:59:03 Done.
+ // 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