diff options
Diffstat (limited to 'base/file_util.cc')
-rw-r--r-- | base/file_util.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/base/file_util.cc b/base/file_util.cc index 79921ff..5bc73ce 100644 --- a/base/file_util.cc +++ b/base/file_util.cc @@ -186,7 +186,8 @@ bool ReadFileToString(const FilePath& path, std::string* contents) { char buf[1 << 16]; size_t len; while ((len = fread(buf, 1, sizeof(buf), file)) > 0) { - contents->append(buf, len); + if (contents) + contents->append(buf, len); } CloseFile(file); |