Index: storage/common/data_element.h |
diff --git a/storage/common/data_element.h b/storage/common/data_element.h |
index 0efe1550a91e9a509d1cc0548854167a58c3a689..333e55b6f3be99f0341c9ed099e1a24e1e8590db 100644 |
--- a/storage/common/data_element.h |
+++ b/storage/common/data_element.h |
@@ -33,7 +33,12 @@ class STORAGE_COMMON_EXPORT DataElement { |
~DataElement(); |
Type type() const { return type_; } |
- const char* bytes() const { return bytes_ ? bytes_ : &buf_[0]; } |
+ const char* bytes() const { |
+ if (length_) |
+ return bytes_ ? bytes_ : &buf_[0]; |
+ else |
+ return nullptr; |
+ } |
const base::FilePath& path() const { return path_; } |
const GURL& filesystem_url() const { return filesystem_url_; } |
const std::string& blob_uuid() const { return blob_uuid_; } |