Fixing fault in ExeNet when a model file does not include an extension.
If you pass a file name without an extension as the -m parameter to
execute network it won't be able to determine the parser to use. This
results in a segmentation fault.
Signed-off-by: Colm Donelan <colm.donelan@arm.com>
Change-Id: I91821a5abd50b65b8d60409aa9a807013e0b0e6a
diff --git a/tests/ExecuteNetwork/ArmNNExecutor.cpp b/tests/ExecuteNetwork/ArmNNExecutor.cpp
index ac857a9..6955a49 100644
--- a/tests/ExecuteNetwork/ArmNNExecutor.cpp
+++ b/tests/ExecuteNetwork/ArmNNExecutor.cpp
@@ -612,7 +612,10 @@
LogAndThrow("Not built with Onnx parser support.");
#endif
}
-
+ if (parser == nullptr)
+ {
+ throw InvalidArgumentException("Unable to determine the model type based on the file name extension.");
+ }
return parser;
}