diff --git a/projects/clr/hipamd/src/hip_stream.cpp b/projects/clr/hipamd/src/hip_stream.cpp index c8a35a53ab..2e80e8e906 100644 --- a/projects/clr/hipamd/src/hip_stream.cpp +++ b/projects/clr/hipamd/src/hip_stream.cpp @@ -463,7 +463,7 @@ hipError_t hipStreamWaitEvent_common(hipStream_t stream, hipEvent_t event, unsig // If stream is capturing but event is not recorded on event's stream. return hipErrorStreamCaptureIsolation; } - if (eventStream->DeviceId() == waitStream->DeviceId()) { + if ((waitStream != nullptr) && (eventStream->DeviceId() == waitStream->DeviceId())) { eventStream->GetDevice()->AddSafeStream(eventStream, waitStream); } }