fix(sync): break when pState is NULL

This commit is contained in:
Minghao Li 2022-10-24 14:09:12 +08:00
parent 2c33026b0e
commit a228d5ecb9
1 changed files with 3 additions and 1 deletions

View File

@ -336,7 +336,9 @@ char* syncNodePeerState2Str(const SSyncNode* pSyncNode) {
for (int32_t i = 0; i < pSyncNode->replicaNum; ++i) {
SPeerState* pState = syncNodeGetPeerState((SSyncNode*)pSyncNode, &(pSyncNode->replicasId[i]));
ASSERT(pState != NULL);
if (pState == NULL) {
break;
}
p = pStr + useLen;
use = snprintf(p, leftLen, "%d:%" PRId64 " ,%" PRId64, i, pState->lastSendIndex, pState->lastSendTime);