summaryrefslogtreecommitdiff
path: root/src/map.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/map.c')
-rw-r--r--src/map.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/map.c b/src/map.c
index a90a731..40f376c 100644
--- a/src/map.c
+++ b/src/map.c
@@ -1304,11 +1304,12 @@ static struct HXrbnode *HXrbtrav_rewalk(struct HXrbtrav *trav)
trav->current = trav->path[--trav->depth];
if (trav->current == NULL)
fprintf(stderr, "btrav_rewalk: problem: current==NULL\n");
- HXrbtrav_checkpoint(trav, trav->current);
+ else
+ HXrbtrav_checkpoint(trav, trav->current);
}
trav->tid = btree->tid;
- if (go_next)
+ if (trav->current != nullptr && go_next)
return HXrbtrav_next(trav);
else
return trav->current;