Commit a08ed540 authored by Steven Bennetts's avatar Steven Bennetts Committed by Commit Bot

Network config UI fixes

This CL:
* Fixes a Polymer2 bug where networkProxy.isShared_ was called while
  networkProperties was undefined without checking, causing a console
  error.
* Fixes a DCHECK in the ONC code when configuring Ethernet nameservers
  or IP config properties.
* Also updates NULL -> nullptr in onc_translation_tables.cc.

Bug: issue 931845
Change-Id: I87a953a0b7779f0d7f4538a5b9e8a5a95f9d5235
Reviewed-on: https://chromium-review.googlesource.com/c/1471307Reviewed-by: default avatarKyle Horimoto <khorimoto@chromium.org>
Commit-Queue: Steven Bennetts <stevenjb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#632010}
parent 88cc4cb3
...@@ -337,9 +337,9 @@ void LocalTranslator::TranslateNetworkConfiguration() { ...@@ -337,9 +337,9 @@ void LocalTranslator::TranslateNetworkConfiguration() {
onc_object_->GetStringWithoutPathExpansion(::onc::network_config::kType, onc_object_->GetStringWithoutPathExpansion(::onc::network_config::kType,
&type); &type);
// Set the type except for Ethernet which is set in TranslateEthernet. // Note; The Ethernet type might be overridden to EthernetEap in
if (type != ::onc::network_type::kEthernet) // TranslateEthernet if Ethernet specific properties are provided.
TranslateWithTableAndSet(type, kNetworkTypeTable, shill::kTypeProperty); TranslateWithTableAndSet(type, kNetworkTypeTable, shill::kTypeProperty);
// Shill doesn't allow setting the name for non-VPN networks. // Shill doesn't allow setting the name for non-VPN networks.
if (type == ::onc::network_type::kVPN) if (type == ::onc::network_type::kVPN)
......
...@@ -452,8 +452,11 @@ Polymer({ ...@@ -452,8 +452,11 @@ Polymer({
* @private * @private
*/ */
isShared_: function() { isShared_: function() {
return this.networkProperties.Source == 'Device' || if (!this.networkProperties) {
this.networkProperties.Source == 'DevicePolicy'; return false;
}
const source = this.networkProperties.Source;
return source == 'Device' || source == 'DevicePolicy';
}, },
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment