diff --git a/adapter/uhdf2/hdi/src/iservmgr_client.cpp b/adapter/uhdf2/hdi/src/iservmgr_client.cpp index 90c53f07d614a56a77a454aa7d75eecb24568661..e8b3fdb95b6b23fb41e96b7eacf2d98e67018fe6 100644 --- a/adapter/uhdf2/hdi/src/iservmgr_client.cpp +++ b/adapter/uhdf2/hdi/src/iservmgr_client.cpp @@ -123,6 +123,11 @@ int32_t ServiceManagerProxy::UnregisterServiceStatusListener(::OHOS::sptr ServiceManagerProxy::GetService(const char *serviceName) { + if (nullptr == serviceName) { + HDF_LOGE("serviceName is nullptr"); + return nullptr; + } + MessageParcel data; MessageParcel reply; if (!data.WriteInterfaceToken(GetDescriptor()) || !data.WriteCString(serviceName)) {