postgis: for an empty table (with null results for extent) return early rather than allowing and printing a lexical cast failure
This commit is contained in:
parent
3b72597f1d
commit
4ab17c9690
1 changed files with 6 additions and 6 deletions
|
@ -665,15 +665,15 @@ box2d<double> postgis_datasource::envelope() const
|
|||
}
|
||||
*/
|
||||
|
||||
shared_ptr<ResultSet> rs=conn->executeQuery(s.str());
|
||||
if (rs->next())
|
||||
shared_ptr<ResultSet> rs = conn->executeQuery(s.str());
|
||||
if (rs->next() && !rs->isNull(0))
|
||||
{
|
||||
try
|
||||
{
|
||||
double lox=lexical_cast<double>(rs->getValue(0));
|
||||
double loy=lexical_cast<double>(rs->getValue(1));
|
||||
double hix=lexical_cast<double>(rs->getValue(2));
|
||||
double hiy=lexical_cast<double>(rs->getValue(3));
|
||||
double lox = lexical_cast<double>(rs->getValue(0));
|
||||
double loy = lexical_cast<double>(rs->getValue(1));
|
||||
double hix = lexical_cast<double>(rs->getValue(2));
|
||||
double hiy = lexical_cast<double>(rs->getValue(3));
|
||||
extent_.init(lox,loy,hix,hiy);
|
||||
extent_initialized_ = true;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue