Handle empty read from file.
Test: run /vendor/bin/dump/dump_power Bug: 312681873 Change-Id: I8c49cf7f0048190f02d35d50984abca361d517f1
This commit is contained in:
parent
09160b77ca
commit
251d00eb0e
1 changed files with 1 additions and 1 deletions
|
@ -362,7 +362,7 @@ void dumpBatteryDefend() {
|
|||
|
||||
for (auto &file : files) {
|
||||
fileLocation = std::string(config[1]) + std::string(file);
|
||||
if (!android::base::ReadFileToString(fileLocation, &content)) {
|
||||
if (!android::base::ReadFileToString(fileLocation, &content) || content.empty()) {
|
||||
content = "\n";
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue