Fix SegFault (#22499)

Fix SegFault reported by
https://github.com/microsoft/onnxruntime/issues/22493.
This commit is contained in:
Vincent Wang 2024-10-21 14:36:28 +08:00 committed by GitHub
parent abad69b322
commit 60da4a2ccd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -48,7 +48,7 @@ bool PreShapeNodeElimination::SatisfyCondition(const Graph& graph, const Node& n
for (const Node* next_node : output_nodes) {
// Check if the next node is not of type "Shape"
if (!graph_utils::IsSupportedOptypeVersionAndDomain(*next_node, "Shape", {13, 15, 19}, kOnnxDomain)) {
if (!next_node || !graph_utils::IsSupportedOptypeVersionAndDomain(*next_node, "Shape", {13, 15, 19}, kOnnxDomain)) {
return false;
}
}