!2229 修改空指针问题

Merge pull request !2229 from rsin/master
This commit is contained in:
openharmony_ci 2024-09-10 03:19:29 +00:00 committed by Gitee
commit c2f00d7a05
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
3 changed files with 8 additions and 0 deletions

View File

@ -109,6 +109,9 @@ bool CoreService::Init()
TELEPHONY_LOGE("NetworkSearchManager init is failed!");
return false;
}
} else {
TELEPHONY_LOGE("NetworkSearchManager calloc failed");
return false;
}
CoreManagerInner::GetInstance().OnInit(networkSearchManager_, simManager_, telRilManager_);
for (int32_t slotId = 0; slotId < SIM_SLOT_COUNT; slotId++) {

View File

@ -725,6 +725,7 @@ void TestGetNrSsbId()
std::shared_ptr<NrSsbInformation> nrSsbInformation = std::make_shared<NrSsbInformation>();
if (nrSsbInformation == nullptr) {
TELEPHONY_LOGE("nrSsbInformation is null");
return;
}
int32_t result = g_telephonyService->GetNrSsbIdInfo(InputSlotId(), nrSsbInformation);
TELEPHONY_LOGI("TelephonyTestService::GetNrSsbIdInfo result:%{public}d", result);

View File

@ -88,6 +88,10 @@ void TelRilTest::ReStartTelephony()
pid = atoi(buf);
}
}
if (fp == nullptr) {
TELEPHONY_LOGE("fp is null");
return;
}
kill(pid, SIGKILL);
pclose(fp);
sleep(WAIT_TELEPHONY_RETART_TIME);