fix(test): check null ptr.

This commit is contained in:
Haojun Liao 2024-12-13 00:15:10 +08:00
parent b8fde1baf4
commit e9f398b3f8
1 changed files with 4 additions and 0 deletions

View File

@ -248,6 +248,10 @@ bool mndIsMnode(SMnode *pMnode, int32_t dnodeId) {
}
void mndGetMnodeEpSet(SMnode *pMnode, SEpSet *pEpSet) {
if (pMnode == NULL || pEpSet == NULL) {
return;
}
SSdb *pSdb = pMnode->pSdb;
int32_t totalMnodes = sdbGetSize(pSdb, SDB_MNODE);
if (totalMnodes == 0) {