Skip to content

Commit a50137c

Browse files
authored
Merge pull request #1445 from mmd-osm/issue_1442
Avoid reading from empty sparseBlock
2 parents bfc3fa3 + 5a644be commit a50137c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/node-ram-cache.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,10 @@ void node_ram_cache::set_dense(osmid_t id, osmium::Location location)
263263

264264
osmium::Location node_ram_cache::get_sparse(osmid_t id) const
265265
{
266+
if (sizeSparseTuples == 0) {
267+
return osmium::Location{};
268+
}
269+
266270
int64_t pivotPos = sizeSparseTuples >> 1;
267271
int64_t minPos = 0;
268272
int64_t maxPos = sizeSparseTuples;

0 commit comments

Comments
 (0)