Skip to content

Commit 6076739

Browse files
committed
EnablePaging methods: check return of Open() method to avoid assertions
1 parent facd70c commit 6076739

File tree

4 files changed

+30
-5
lines changed

4 files changed

+30
-5
lines changed

Diff for: mapmssql2008.c

+6-1
Original file line numberDiff line numberDiff line change
@@ -3027,7 +3027,12 @@ void msMSSQL2008EnablePaging(layerObj *layer, int value)
30273027
msMSSQL2008LayerInfo *layerinfo = NULL;
30283028

30293029
if (!msMSSQL2008LayerIsOpen(layer))
3030-
msMSSQL2008LayerOpen(layer);
3030+
{
3031+
if(msMSSQL2008LayerOpen(layer) != MS_SUCCESS)
3032+
{
3033+
return;
3034+
}
3035+
}
30313036

30323037
assert(layer->layerinfo != NULL);
30333038
layerinfo = (msMSSQL2008LayerInfo *)layer->layerinfo;

Diff for: mapogr.cpp

+12-2
Original file line numberDiff line numberDiff line change
@@ -5384,7 +5384,12 @@ static void msOGREnablePaging(layerObj *layer, int value)
53845384
}
53855385

53865386
if(!msOGRLayerIsOpen(layer))
5387-
msOGRLayerOpenVT(layer);
5387+
{
5388+
if(msOGRLayerOpenVT(layer) != MS_SUCCESS)
5389+
{
5390+
return;
5391+
}
5392+
}
53885393

53895394
assert( layer->layerinfo != NULL);
53905395

@@ -5401,7 +5406,12 @@ static int msOGRGetPaging(layerObj *layer)
54015406
}
54025407

54035408
if(!msOGRLayerIsOpen(layer))
5404-
msOGRLayerOpenVT(layer);
5409+
{
5410+
if(msOGRLayerOpenVT(layer) != MS_SUCCESS)
5411+
{
5412+
return FALSE;
5413+
}
5414+
}
54055415

54065416
assert( layer->layerinfo != NULL);
54075417

Diff for: maporaclespatial.c

+6-1
Original file line numberDiff line numberDiff line change
@@ -3477,7 +3477,12 @@ void msOracleSpatialEnablePaging(layerObj *layer, int value)
34773477
msDebug("msOracleSpatialLayerEnablePaging was called.\n");
34783478

34793479
if(!msOracleSpatialLayerIsOpen(layer))
3480-
msOracleSpatialLayerOpen(layer);
3480+
{
3481+
if(msOracleSpatialLayerOpen(layer) != MS_SUCCESS)
3482+
{
3483+
return;
3484+
}
3485+
}
34813486

34823487
assert( layer->layerinfo != NULL);
34833488
layerinfo = (msOracleSpatialLayerInfo *)layer->layerinfo;

Diff for: mappostgis.c

+6-1
Original file line numberDiff line numberDiff line change
@@ -3985,7 +3985,12 @@ void msPostGISEnablePaging(layerObj *layer, int value)
39853985
}
39863986

39873987
if(!msPostGISLayerIsOpen(layer))
3988-
msPostGISLayerOpen(layer);
3988+
{
3989+
if(msPostGISLayerOpen(layer) != MS_SUCCESS)
3990+
{
3991+
return;
3992+
}
3993+
}
39893994

39903995
assert( layer->layerinfo != NULL);
39913996

0 commit comments

Comments
 (0)