summaryrefslogtreecommitdiff
path: root/core/libdeno/api.cc
diff options
context:
space:
mode:
Diffstat (limited to 'core/libdeno/api.cc')
-rw-r--r--core/libdeno/api.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/libdeno/api.cc b/core/libdeno/api.cc
index 18dc1d43e..061638cb5 100644
--- a/core/libdeno/api.cc
+++ b/core/libdeno/api.cc
@@ -165,7 +165,7 @@ void deno_respond(Deno* d_, void* user_data, deno_op_id op_id, deno_buf buf) {
if (d->current_args_ != nullptr) {
// Synchronous response.
// Note op_id is not passed back in the case of synchronous response.
- if (buf.data_ptr != nullptr) {
+ if (buf.data_ptr != nullptr && buf.data_len > 0) {
auto ab = deno::ImportBuf(d, buf);
d->current_args_->GetReturnValue().Set(ab);
}