Commit 84e35b65 authored by Jon Mann's avatar Jon Mann Committed by Commit Bot

Fix crash when cellular modem is disconnected.

Bug: 1001687
Change-Id: I50c527dcce3ffc5b831519c346ff0db30f5495a7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1790471
Commit-Queue: Jon Mann <jonmann@chromium.org>
Reviewed-by: default avatarKyle Horimoto <khorimoto@chromium.org>
Reviewed-by: default avatarSteven Bennetts <stevenjb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#694975}
parent 70c2faae
...@@ -205,7 +205,14 @@ mojom::NetworkStatePropertiesPtr NetworkStateToMojo( ...@@ -205,7 +205,14 @@ mojom::NetworkStatePropertiesPtr NetworkStateToMojo(
// is not connectable. // is not connectable.
const DeviceState* device = const DeviceState* device =
network_state_handler->GetDeviceState(network->device_path()); network_state_handler->GetDeviceState(network->device_path());
DCHECK(device) << "Device path not found: " << network->device_path(); if (!device) {
// When a device is removed (e.g. cellular modem unplugged) it's possible
// for the device object to disappear before networks on that device
// are cleaned up. This fixes crbug/1001687.
NET_LOG(DEBUG) << "Cellular is not available.";
return nullptr;
}
if (device->IsSimLocked() || device->scanning()) if (device->IsSimLocked() || device->scanning())
result->connectable = false; result->connectable = false;
} }
......
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