Skip to content

Commit ee2679c

Browse files
committed
make sure it is also safe in TAG
1 parent dce4bd8 commit ee2679c

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

src/profile.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,12 @@ void printInvIdxIt(RedisModule_Reply *reply, QueryIterator *root, ProfileCounter
3434

3535
RedisModule_Reply_Map(reply);
3636
if (IndexReader_Flags(it->reader) == Index_DocIdsOnly) {
37-
RSQueryTerm *term = IndexResult_QueryTermRef(root->current);
38-
if (term != NULL) {
39-
printProfileType("TAG");
40-
REPLY_KVSTR_SAFE("Term", term->str);
37+
if (root && root->current) {
38+
RSQueryTerm *term = IndexResult_QueryTermRef(root->current);
39+
if (term != NULL) {
40+
printProfileType("TAG");
41+
REPLY_KVSTR_SAFE("Term", term->str);
42+
}
4143
}
4244
} else if (IndexReader_Flags(it->reader) & Index_StoreNumeric) {
4345
const NumericFilter *flt = IndexReader_NumericFilter(it->reader);

0 commit comments

Comments
 (0)