diff --git a/sinkhandler/src/distributed_input_sink_handler.cpp b/sinkhandler/src/distributed_input_sink_handler.cpp index 817b90f..20a5a13 100644 --- a/sinkhandler/src/distributed_input_sink_handler.cpp +++ b/sinkhandler/src/distributed_input_sink_handler.cpp @@ -128,13 +128,17 @@ void DistributedInputSinkHandler::OnRemoteSinkSvrDied(const wptr DHLOGE("dInputSinkProxy_ is nullptr."); return; } + if (dInputSinkProxy_->AsObject() == nullptr) { + DHLOGE("AsObject is nullptr."); + return; + } sptr remoteObject = remote.promote(); if (remoteObject == nullptr) { DHLOGE("OnRemoteDied remote promoted failed"); return; } - if (dInputSinkProxy_ ->AsObject() != remoteObject) { + if (dInputSinkProxy_->AsObject() != remoteObject) { DHLOGE("OnRemoteSinkSvrDied not found remote object."); return; }