check if featureset is valid before passing to filter_featureset

This commit is contained in:
Artem Pavlenko 2006-12-07 15:02:08 +00:00
parent e0ed71ff6a
commit c7c4659e30

View file

@ -338,9 +338,9 @@ namespace mapnik
#ifdef MAPNIK_DEBUG
std::clog << " query at point tol = " << tol << " (" << x << "," << y << ")\n";
#endif
featureset_ptr fs(new filter_featureset<hit_test_filter>(ds->features_at_point(mapnik::coord2d(x,y)),
hit_test_filter(x,y,tol)));
return fs;
featureset_ptr fs = ds->features_at_point(mapnik::coord2d(x,y));
if (fs)
return featureset_ptr(new filter_featureset<hit_test_filter>(fs,hit_test_filter(x,y,tol)));
}
}
catch (...)
@ -383,10 +383,9 @@ namespace mapnik
#ifdef MAPNIK_DEBUG
std::clog << " query at point tol = " << tol << " (" << x << "," << y << ")\n";
#endif
featureset_ptr fs(new filter_featureset<hit_test_filter>(ds->features_at_point(mapnik::coord2d(x,y)),
hit_test_filter(x,y,tol)));
return fs;
featureset_ptr fs = ds->features_at_point(mapnik::coord2d(x,y));
if (fs)
return featureset_ptr(new filter_featureset<hit_test_filter>(fs,hit_test_filter(x,y,tol)));
}
}
catch (...)