Skip to content

Commit 98ad83a

Browse files
committed
msQueryByFeatures(): avoid potential segfault when reslut set is empty
1 parent e2ef155 commit 98ad83a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mapquery.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1617,7 +1617,7 @@ int msQueryByFeatures(mapObj *map)
16171617

16181618
} /* next selection shape */
16191619

1620-
if(lp->resultcache->numresults == 0) msLayerClose(lp); /* no need to keep the layer open */
1620+
if(lp->resultcache == NULL || lp->resultcache->numresults == 0) msLayerClose(lp); /* no need to keep the layer open */
16211621
} /* next layer */
16221622

16231623
/* was anything found? */

0 commit comments

Comments
 (0)