Fix No Phone Number scenario

Fix:
In the scenario where a phone number is not able to be read from the SIM, QuecManager will now continue to provide other stats.

Co-Authored-By: Russel Yasol <73575327+dr-dolomite@users.noreply.github.com>
This commit is contained in:
Cameron Thompson
2024-10-29 23:44:48 +00:00
parent b5f299dfb2
commit c8faf539c1

View File

@@ -247,8 +247,13 @@ function processSimData(jsonData) {
setText("simSlot", simSlot);
// Phone Number
const phoneNumber = extractValue(phoneResponse.response).split(",")[1].replace(/"/g, "").trim();
setText("phoneNumber", phoneNumber);
// If trim is an error, return no phone number
try {
const phoneNumber = extractValue(phoneResponse.response).split(",")[1].replace(/"/g, "").trim();
setText("phoneNumber", phoneNumber);
} catch (error) {
setText("phoneNumber", "-");
}
// SIM Provider and Access Technology
const providerData = extractValue(providerResponse.response).split(",");