Fix crash while loading config due to incorrect tw_storage_path

Change-Id: Ia5957efe616defa4272501cd8f31d26d394077bb
Signed-off-by: Vojtech Bocek <vbocek@gmail.com>
This commit is contained in:
Vojtech Bocek
2014-05-12 15:41:52 +02:00
committed by Gerrit Code Review
parent ee71706ad1
commit 93cb1ef2eb
3 changed files with 26 additions and 2 deletions
+16
View File
@@ -1955,3 +1955,19 @@ void TWPartitionManager::Output_Storage_Fstab(void) {
}
fclose(fp);
}
TWPartition *TWPartitionManager::Get_Default_Storage_Partition()
{
TWPartition *res = NULL;
for (std::vector<TWPartition*>::iterator iter = Partitions.begin(); iter != Partitions.end(); ++iter) {
if(!(*iter)->Is_Storage)
continue;
if((*iter)->Is_Settings_Storage)
return *iter;
if(!res)
res = *iter;
}
return res;
}