refacotr(sync): judge peer state null

This commit is contained in:
Minghao Li 2022-10-21 15:22:34 +08:00
parent 984af8a877
commit 3c94d61493
1 changed files with 3 additions and 1 deletions

View File

@ -3453,7 +3453,9 @@ SPeerState* syncNodeGetPeerState(SSyncNode* ths, const SRaftId* pDestId) {
bool syncNodeNeedSendAppendEntries(SSyncNode* ths, const SRaftId* pDestId, const SyncAppendEntries* pMsg) {
SPeerState* pState = syncNodeGetPeerState(ths, pDestId);
ASSERT(pState != NULL);
if (pState == NULL) {
return false;
}
SyncIndex sendIndex = pMsg->prevLogIndex + 1;
int64_t tsNow = taosGetTimestampMs();