Index: chromeos/display/output_configurator.cc |
diff --git a/chromeos/display/output_configurator.cc b/chromeos/display/output_configurator.cc |
index d3f23114e496d6c989bf7c6a4b91bf569b267069..c38a4ca15437e65680fe46c3172d6ab480c4b358 100644 |
--- a/chromeos/display/output_configurator.cc |
+++ b/chromeos/display/output_configurator.cc |
@@ -240,12 +240,14 @@ OutputConfigurator::OutputConfigurator(bool is_extended_display_enabled) |
// Note that this can be removed once the legacy powerd support is removed. |
chromeos::DBusThreadManager* manager = chromeos::DBusThreadManager::Get(); |
dbus::Bus* bus = manager->GetSystemBus(); |
- dbus::ExportedObject* remote_object = bus->GetExportedObject( |
- dbus::ObjectPath(power_manager::kPowerManagerServicePath)); |
- dbus::Signal signal(power_manager::kPowerManagerInterface, |
- power_manager::kUseNewMonitorConfigSignal); |
- CHECK(signal.raw_message() != NULL); |
- remote_object->SendSignal(&signal); |
+ if (bus) { |
+ dbus::ExportedObject* remote_object = bus->GetExportedObject( |
+ dbus::ObjectPath(power_manager::kPowerManagerServicePath)); |
+ dbus::Signal signal(power_manager::kPowerManagerInterface, |
+ power_manager::kUseNewMonitorConfigSignal); |
+ CHECK(signal.raw_message() != NULL); |
+ remote_object->SendSignal(&signal); |
+ } |
// Cache the initial output state. |
Display* display = base::MessagePumpAuraX11::GetDefaultXDisplay(); |
@@ -843,18 +845,20 @@ void OutputConfigurator::CheckIsProjectingAndNotify() { |
bool is_projecting = has_internal_output && (connected_output_count > 1); |
chromeos::DBusThreadManager* manager = chromeos::DBusThreadManager::Get(); |
dbus::Bus* bus = manager->GetSystemBus(); |
- dbus::ObjectProxy* power_manager_proxy = bus->GetObjectProxy( |
- power_manager::kPowerManagerServiceName, |
- dbus::ObjectPath(power_manager::kPowerManagerServicePath)); |
- dbus::MethodCall method_call( |
- power_manager::kPowerManagerInterface, |
- power_manager::kSetIsProjectingMethod); |
- dbus::MessageWriter writer(&method_call); |
- writer.AppendBool(is_projecting); |
- power_manager_proxy->CallMethod( |
- &method_call, |
- dbus::ObjectProxy::TIMEOUT_USE_DEFAULT, |
- dbus::ObjectProxy::EmptyResponseCallback()); |
+ if (bus) { |
+ dbus::ObjectProxy* power_manager_proxy = bus->GetObjectProxy( |
+ power_manager::kPowerManagerServiceName, |
+ dbus::ObjectPath(power_manager::kPowerManagerServicePath)); |
+ dbus::MethodCall method_call( |
+ power_manager::kPowerManagerInterface, |
+ power_manager::kSetIsProjectingMethod); |
+ dbus::MessageWriter writer(&method_call); |
+ writer.AppendBool(is_projecting); |
+ power_manager_proxy->CallMethod( |
+ &method_call, |
+ dbus::ObjectProxy::TIMEOUT_USE_DEFAULT, |
+ dbus::ObjectProxy::EmptyResponseCallback()); |
+ } |
} |
void OutputConfigurator::NotifyOnDisplayChanged() { |