Index: third_party/WebKit/Source/core/testing/Internals.cpp |
diff --git a/third_party/WebKit/Source/core/testing/Internals.cpp b/third_party/WebKit/Source/core/testing/Internals.cpp |
index c74a35d0eff8cccb30dd255013b8b8bc0f089c24..4223b2a14350c9bf098e350b0ea173382663c157 100644 |
--- a/third_party/WebKit/Source/core/testing/Internals.cpp |
+++ b/third_party/WebKit/Source/core/testing/Internals.cpp |
@@ -2644,10 +2644,12 @@ bool Internals::cursorUpdatePending() const { |
DOMArrayBuffer* Internals::serializeObject( |
PassRefPtr<SerializedScriptValue> value) const { |
String stringValue = value->toWireString(); |
- DOMArrayBuffer* buffer = |
- DOMArrayBuffer::createUninitialized(stringValue.length(), sizeof(UChar)); |
- stringValue.copyTo(static_cast<UChar*>(buffer->data()), 0, |
- stringValue.length()); |
+ DOMArrayBuffer* buffer = DOMArrayBuffer::createUninitializedOrNull( |
+ stringValue.length(), sizeof(UChar)); |
+ if (buffer) { |
+ stringValue.copyTo(static_cast<UChar*>(buffer->data()), 0, |
+ stringValue.length()); |
+ } |
return buffer; |
} |