Skip to content
Snippets Groups Projects
Commit 3a342784 authored by Julien Michel's avatar Julien Michel
Browse files

BUG: Drivername may be valid, but OGR still can not create the driver because...

BUG: Drivername may be valid, but OGR still can not create the driver because it has been compiled withtout the appropriate dependency. Avoiding segmentation fault in this case
parent f5e80d63
No related branches found
No related tags found
No related merge requests found
......@@ -161,7 +161,12 @@ otb::ogr::DataSource::Pointer otb::ogr::DataSource::OpenDataSource(std::string c
}
OGRSFDriver * d = OGRSFDriverRegistrar::GetRegistrar()->GetDriverByName(driverName);
assert(d && "OGR driver not found");
if(!d)
{
itkGenericExceptionMacro(<<"Could not create OGR driver "<<driverName<<", check your OGR configuration for available drivers.");
}
source = d->CreateDataSource(datasourceName.c_str());
if (!source) {
itkGenericExceptionMacro(<< "Failed to create OGRDataSource <"<<datasourceName
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment