diff --git a/interfaces/ipc/src/distributed_input_sink_stub.cpp b/interfaces/ipc/src/distributed_input_sink_stub.cpp index 306f6e4..04b77e3 100644 --- a/interfaces/ipc/src/distributed_input_sink_stub.cpp +++ b/interfaces/ipc/src/distributed_input_sink_stub.cpp @@ -138,6 +138,10 @@ int32_t DistributedInputSinkStub::NotifyStopDScreenInner(MessageParcel &data, Me int32_t DistributedInputSinkStub::RegisterSharingDhIdListenerInner(MessageParcel &data, MessageParcel &reply, MessageOption &option) { + if (data.ReadRemoteObject() == nullptr) { + DHLOGE("RegisterSharingDhIdListenerInner failed, data.ReadRemoteObject is nullptr."); + return ERR_DH_INPUT_SINK_STUB_REGISTER_SHARING_DHID_LISTENER_FAIL; + } sptr listener = iface_cast(data.ReadRemoteObject()); int32_t ret = RegisterSharingDhIdListener(listener); if (!reply.WriteInt32(ret)) {