Index: src/core/SkRWBuffer.cpp |
diff --git a/src/core/SkRWBuffer.cpp b/src/core/SkRWBuffer.cpp |
index 0784378d99a77d9c084f02d4f6b7d57476b7ae60..c0a93bdf53c037ce768a0699983f1d7cf1ce30d5 100644 |
--- a/src/core/SkRWBuffer.cpp |
+++ b/src/core/SkRWBuffer.cpp |
@@ -168,7 +168,9 @@ SkRWBuffer::SkRWBuffer(size_t initialCapacity) : fHead(nullptr), fTail(nullptr), |
SkRWBuffer::~SkRWBuffer() { |
this->validate(); |
- fHead->unref(); |
+ if (fHead) { |
+ fHead->unref(); |
+ } |
} |
void SkRWBuffer::append(const void* src, size_t length) { |