diff --git a/src/vnode/src/vnodeMain.c b/src/vnode/src/vnodeMain.c index be46076816efedb99cb470e623b6b61de464e79e..8de0fa43e9aa60906c7f75b7bd78d498539a0658 100644 --- a/src/vnode/src/vnodeMain.c +++ b/src/vnode/src/vnodeMain.c @@ -522,7 +522,10 @@ static void vnodeBuildVloadMsg(SVnodeObj *pVnode, SDMStatusMsg *pStatus) { int32_t vnodeGetVnodeList(int32_t vnodeList[], int32_t *numOfVnodes) { SHashMutableIterator *pIter = taosHashCreateIter(tsDnodeVnodesCache->pHashTable); while (taosHashIterNext(pIter)) { - SVnodeObj **pVnode = taosHashIterGet(pIter); + SCacheDataNode **pNode = taosHashIterGet(pIter); + if (pNode == NULL || *pNode == NULL) break; + + SVnodeObj **pVnode = (SVnodeObj **)((*pNode)->data); if (pVnode == NULL) continue; if (*pVnode == NULL) continue; @@ -544,7 +547,10 @@ void vnodeBuildStatusMsg(void *param) { SHashMutableIterator *pIter = taosHashCreateIter(tsDnodeVnodesCache->pHashTable); while (taosHashIterNext(pIter)) { - SVnodeObj **pVnode = taosHashIterGet(pIter); + SCacheDataNode **pNode = taosHashIterGet(pIter); + if (pNode == NULL || *pNode == NULL) break; + + SVnodeObj **pVnode = (SVnodeObj **)((*pNode)->data); if (pVnode == NULL) continue; if (*pVnode == NULL) continue;