mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Add assertion when building MapBuffer
Summary: This diff adds an assertion when trying to build a MapBuffer with invalid data changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D27864309 fbshipit-source-id: 6601388e56be18ded0675f92cce009a577828c16
This commit is contained in:
committed by
Facebook GitHub Bot
parent
4d9973fa59
commit
e2b9c61998
@@ -160,6 +160,10 @@ void MapBufferBuilder::putMapBuffer(Key key, MapBuffer &map) {
|
||||
}
|
||||
|
||||
MapBuffer MapBufferBuilder::build() {
|
||||
react_native_assert(
|
||||
(keyValues_ != nullptr) &&
|
||||
"Error when building mapbuffer with invalid datastructures.");
|
||||
|
||||
// Create buffer: [header] + [key, values] + [dynamic data]
|
||||
int bufferSize = keyValuesOffset_ + dynamicDataOffset_;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user