Skip to content

Commit 2621d2c

Browse files
committed
SERXIONE-6937: SystemServices Crash
Reason for change: Add a try/catch within getTerritory Test Procedure: Risks: low Priority: P1 Signed-off-by:Hayden Gfeller <[email protected]>
1 parent 711ff81 commit 2621d2c

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

SystemServices/SystemServices.cpp

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2711,7 +2711,8 @@ namespace WPEFramework {
27112711
bool SystemServices::readTerritoryFromFile()
27122712
{
27132713
bool retValue = true;
2714-
if(Utils::fileExists(TERRITORYFILE)){
2714+
try{
2715+
if(Utils::fileExists(TERRITORYFILE)){
27152716
ifstream inFile(TERRITORYFILE);
27162717
string str;
27172718
getline (inFile, str);
@@ -2744,9 +2745,16 @@ namespace WPEFramework {
27442745
}
27452746
inFile.close();
27462747

2747-
}else{
2748-
LOGERR("Territory is not set");
2749-
}
2748+
}else{
2749+
LOGERR("Territory is not set");
2750+
}
2751+
}
2752+
catch(...){
2753+
LOGERR("Exception caught while reading territory file");
2754+
retValue = false;
2755+
m_strTerritory = "";
2756+
m_strRegion = "";
2757+
}
27502758
return retValue;
27512759
}
27522760

0 commit comments

Comments
 (0)