diff --git a/frameworks/native/src/sensor_service_client.cpp b/frameworks/native/src/sensor_service_client.cpp index 42b7211845c1e3c22e4d022732f8845c928da761..1e1a5796e16c069eb49c4572d9f918a5cd436d8f 100644 --- a/frameworks/native/src/sensor_service_client.cpp +++ b/frameworks/native/src/sensor_service_client.cpp @@ -77,6 +77,7 @@ int32_t SensorServiceClient::DealAfterServiceAlive() ret = TransferClientRemoteObject(); if (ret != ERR_OK) { SEN_HILOGE("TransferClientRemoteObject failed, ret:%{public}d", ret); + sensorServer_ = nullptr; } return ret; } @@ -143,6 +144,7 @@ bool SensorServiceClient::LoadSensorService() int32_t ret = DealAfterServiceAlive(); if (ret != ERR_OK) { SEN_HILOGE("DealAfterServiceAlive failed, ret:%{public}d", ret); + sensorServer_ = nullptr; return false; } return true;