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

BUG: Fixing potential bug on number of layers in dataset

parent 3c078b86
Branches
Tags
No related merge requests found
......@@ -411,7 +411,13 @@ void otb::ogr::DataSource::GetGlobalExtent(double & ulx,
OGREnvelope sExtent;
const_iterator lit = this->begin();
const OGRErr res = lit->ogr().GetExtent(&sExtent,force);
if(lit==this->end())
{
itkGenericExceptionMacro(<< "Cannot compute global extent because there are no layers in the DataSource");
}
const OGRErr res = lit->ogr().GetExtent(&sExtent,force);
if(res!= OGRERR_NONE)
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment