Commit 4c3f8006 authored by Julien Malik's avatar Julien Malik

TEST: avoid segfault in otbImageClassificationFilter

parent d47c751e
......@@ -59,6 +59,12 @@ int otbImageClassificationFilter(int itkNotUsed(argc), char * argv[])
model = MachineLearningModelFactoryType::CreateMachineLearningModel(modelfname,
MachineLearningModelFactoryType::ReadMode);
if (model.IsNull())
{
std::cerr << "Unable to create a model from " << modelfname << std::endl;
return EXIT_FAILURE;
}
model->Load(modelfname);
filter->SetModel(model);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment