From 8eb3dc16c3d05cd0d4b6fe45489a2a6e98411fe1 Mon Sep 17 00:00:00 2001 From: Artur Wojcik Date: Tue, 10 Mar 2026 18:09:26 +0100 Subject: [PATCH] check for nullptr before dereferencing --- onnxruntime/core/graph/ep_api_types.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/onnxruntime/core/graph/ep_api_types.cc b/onnxruntime/core/graph/ep_api_types.cc index d30c7cd74a76a..6f492266b0e4c 100644 --- a/onnxruntime/core/graph/ep_api_types.cc +++ b/onnxruntime/core/graph/ep_api_types.cc @@ -351,7 +351,8 @@ static Status GetOutputIndex(const EpNode& producer_node, gsl::span outputs = producer_node.GetOutputsSpan(); for (size_t i = 0; i < outputs.size(); i++) { - if (outputs[i]->GetName() == value_info_name) { + const auto output = outputs[i]; + if (output != nullptr && output->GetName() == value_info_name) { index = i; found = true; }