From c6fc2b8de237c498a7c518e0d3ccb5a89da7aca9 Mon Sep 17 00:00:00 2001 From: Carter Medlin Date: Mon, 19 Jul 2021 11:19:36 -0700 Subject: [PATCH] Update Requestable.js I've had issues using `Repository.createBlob(buffer)` that would cause an exception when looking for `response.data` in a null response. Adding this line allows the code to work for me. --- lib/Requestable.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/Requestable.js b/lib/Requestable.js index 4d6e8d9d..8a74b095 100644 --- a/lib/Requestable.js +++ b/lib/Requestable.js @@ -184,7 +184,9 @@ class Requestable { if (cb) { requestPromise.then((response) => { - if (response.data && Object.keys(response.data).length > 0) { + if (!response) { + cb(null, null, response); + } else if (response.data && Object.keys(response.data).length > 0) { // When data has results cb(null, response.data, response); } else if (config.method !== 'GET' && Object.keys(response.data).length < 1) {