diff --git a/src/util/src/hash.c b/src/util/src/hash.c index be4baf85d2695fc4879545e7995937215777c071..698bcbb15ff4f36242e7eb9e10ec8aeb8830b469 100644 --- a/src/util/src/hash.c +++ b/src/util/src/hash.c @@ -298,11 +298,13 @@ void *taosHashGetCB(SHashObj *pHashObj, const void *key, size_t keyLen, void (*f } SHashNode *pNode = doSearchInEntryList(pe, key, keyLen, hashVal); - if (fp != NULL) { - fp(pNode->data); + if (pNode != NULL) { + if (fp != NULL) { + fp(pNode->data); + } + data = pNode->data; } - data = pNode->data; if (pHashObj->type == HASH_ENTRY_LOCK) { taosRUnLockLatch(&pe->latch); }