Handle zero-length Buffers in Node.js v13.2.0+

These now use nullptr internally - see
https://github.com/nodejs/node/pull/30339
This commit is contained in:
Lovell Fuller
2019-11-28 21:20:32 +00:00
parent bb15cd9067
commit 400ef71b6f
3 changed files with 6 additions and 1 deletions

View File

@@ -49,6 +49,7 @@ namespace sharp {
char *buffer;
bool failOnError;
size_t bufferLength;
bool isBuffer;
double density;
int rawChannels;
int rawWidth;
@@ -64,6 +65,7 @@ namespace sharp {
buffer(nullptr),
failOnError(TRUE),
bufferLength(0),
isBuffer(FALSE),
density(72.0),
rawChannels(0),
rawWidth(0),