Fix statsd crash caused by non-existing data folder.

Test: manual
Change-Id: Ie470279929ff6ce40c4828a3cdda6d78542a3caa
This commit is contained in:
Yao Chen
2017-11-25 15:33:09 -08:00
parent c6a55e5bb0
commit 7250622b47

View File

@@ -129,7 +129,7 @@ void StorageManager::sendBroadcast(const char* path,
void StorageManager::appendConfigMetricsReport(const char* path, ProtoOutputStream& proto) {
unique_ptr<DIR, decltype(&closedir)> dir(opendir(path), closedir);
if (dir != NULL) {
if (dir == NULL) {
VLOG("Path %s does not exist", path);
return;
}