File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -98,7 +98,7 @@ using v8::Value;
9898 const char * v = \
9999 reinterpret_cast <const char *>(sqlite3_##from##_text (__VA_ARGS__)); \
100100 if (v == nullptr ) { \
101- (result) = Null (( isolate)); \
101+ THROW_ERR_MEMORY_ALLOCATION_FAILED ( isolate); \
102102 } else { \
103103 (result) = String::NewFromUtf8 ((isolate), v).As <Value>(); \
104104 } \
@@ -115,7 +115,9 @@ using v8::Value;
115115 sqlite3_##from##_blob (__VA_ARGS__)); \
116116 auto store = ArrayBuffer::NewBackingStore ( \
117117 (isolate), size, BackingStoreInitializationMode::kUninitialized ); \
118- memcpy (store->Data (), data, size); \
118+ if (data) { \
119+ memcpy (store->Data (), data, size); \
120+ } \
119121 auto ab = ArrayBuffer::New ((isolate), std::move (store)); \
120122 (result) = Uint8Array::New (ab, 0 , size); \
121123 break ; \
You can’t perform that action at this time.
0 commit comments