Handle empty read from file.
Test: run /vendor/bin/dump/dump_power Bug: 317934817 Change-Id: Ia4453483fdfaba838a1ffb3d38b243dceb9628e7 Signed-off-by: Jenny Ho <hsiufangho@google.com>
This commit is contained in:
parent
a084844075
commit
1257aa5cdd
1 changed files with 1 additions and 1 deletions
|
@ -374,7 +374,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