summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/sord.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/sord.c b/src/sord.c
index fbc33f7..22732c9 100644
--- a/src/sord.c
+++ b/src/sord.c
@@ -445,7 +445,9 @@ sord_iter_get(const SordIter* iter, SordQuad id)
const SordNode*
sord_iter_get_node(const SordIter* iter, SordQuadIndex index)
{
- return iter ? ((SordNode**)zix_btree_get(iter->cur))[index] : NULL;
+ return (!sord_iter_end(iter)
+ ? ((SordNode**)zix_btree_get(iter->cur))[index]
+ : NULL);
}
static bool