Commit 0cbf2395 authored by Julien Michel's avatar Julien Michel

BUG: Fixing potential bug on number of layers in dataset

parent 3c078b86
......@@ -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)
{
......
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