aboutsummaryrefslogtreecommitdiff
path: root/delegate/classic/src/armnn_delegate.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'delegate/classic/src/armnn_delegate.cpp')
-rw-r--r--delegate/classic/src/armnn_delegate.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/delegate/classic/src/armnn_delegate.cpp b/delegate/classic/src/armnn_delegate.cpp
index 2483835989..de2aa0c632 100644
--- a/delegate/classic/src/armnn_delegate.cpp
+++ b/delegate/classic/src/armnn_delegate.cpp
@@ -312,7 +312,12 @@ TfLiteStatus ArmnnSubgraph::AddOutputLayer(DelegateData& delegateData,
armnn::IConnectableLayer* layer = delegateData.m_Network->AddOutputLayer(bindingId);
auto tensorInfo = GetTensorInfoForTfLiteTensor(tensor);
- ARMNN_ASSERT(delegateData.m_OutputSlotForNode[static_cast<unsigned long>(tensorId)] != nullptr);
+
+ if (delegateData.m_OutputSlotForNode[static_cast<unsigned long>(tensorId)] == nullptr)
+ {
+ return kTfLiteError;
+ }
+
delegateData.m_OutputSlotForNode[static_cast<unsigned long>(tensorId)]->Connect(layer->GetInputSlot(0));
outputBindings.push_back(std::make_pair(bindingId, tensorInfo));
}