Index: Source/modules/crypto/Crypto.cpp |
diff --git a/Source/modules/crypto/Crypto.cpp b/Source/modules/crypto/Crypto.cpp |
index 01a3f19e8c75dddc0030f659499ebc33549f749d..5d7e66ab2d13838b75b146fed18add358350ea4c 100644 |
--- a/Source/modules/crypto/Crypto.cpp |
+++ b/Source/modules/crypto/Crypto.cpp |
@@ -53,21 +53,22 @@ bool isIntegerArray(DOMArrayBufferView* array) |
} // namespace |
-void Crypto::getRandomValues(DOMArrayBufferView* array, ExceptionState& exceptionState) |
+DOMArrayBufferView* Crypto::getRandomValues(DOMArrayBufferView* array, ExceptionState& exceptionState) |
{ |
if (!array) { |
exceptionState.throwDOMException(TypeMismatchError, "The provided ArrayBufferView is null."); |
- return; |
+ return nullptr; |
} |
if (!isIntegerArray(array)) { |
exceptionState.throwDOMException(TypeMismatchError, String::format("The provided ArrayBufferView is of type '%s', which is not an integer array type.", array->typeName())); |
- return; |
+ return nullptr; |
} |
if (array->byteLength() > 65536) { |
exceptionState.throwDOMException(QuotaExceededError, String::format("The ArrayBufferView's byte length (%u) exceeds the number of bytes of entropy available via this API (65536).", array->byteLength())); |
- return; |
+ return nullptr; |
} |
cryptographicallyRandomValues(array->baseAddress(), array->byteLength()); |
+ return array; |
} |
SubtleCrypto* Crypto::subtle() |