size_t offset = args[1]->Int32Value();
- if (offset >= buffer->length_) {
+ if (s->Utf8Length() > 0 && offset >= buffer->length_) {
return ThrowException(Exception::TypeError(String::New(
"Offset is out of bounds")));
}
size_t offset = args[1]->Int32Value();
- if (offset >= buffer->length_) {
+ if (s->Length() > 0 && offset >= buffer->length_) {
return ThrowException(Exception::TypeError(String::New(
"Offset is out of bounds")));
}
size_t offset = args[1]->Int32Value();
- if (offset >= buffer->length_) {
+ if (s->Length() > 0 && offset >= buffer->length_) {
return ThrowException(Exception::TypeError(String::New(
"Offset is out of bounds")));
}