Merge "Handle empty read from file." into main

This commit is contained in:
Treehugger Robot 2023-11-29 17:59:23 +00:00 committed by Android (Google) Code Review
commit d05c6ad1e6

View file

@ -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";
}