fix(sync): checkout NULL pointer

This commit is contained in:
Minghao Li 2022-12-08 15:21:41 +08:00
parent 9f38bfeb2c
commit abd5c696f0
1 changed files with 2 additions and 1 deletions

View File

@ -1640,7 +1640,8 @@ void syncNodeBecomeLeader(SSyncNode* pSyncNode, const char* debugStr) {
#endif
// close receiver
if (snapshotReceiverIsStart(pSyncNode->pNewNodeReceiver)) {
if (pSyncNode != NULL && pSyncNode->pNewNodeReceiver != NULL &&
snapshotReceiverIsStart(pSyncNode->pNewNodeReceiver)) {
snapshotReceiverForceStop(pSyncNode->pNewNodeReceiver);
}