From 3acacd2e2ed1ded2914d615cf8d5a606b7b8cf82 Mon Sep 17 00:00:00 2001 From: Ran Ribenzaft Date: Wed, 2 Dec 2020 14:30:21 +0200 Subject: [PATCH] fix(google_cloud.js): fix job id extraction (#396) --- src/events/google_cloud.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/events/google_cloud.js b/src/events/google_cloud.js index e7199abf..86ab529c 100644 --- a/src/events/google_cloud.js +++ b/src/events/google_cloud.js @@ -48,7 +48,9 @@ function bigQueryWrapper(wrappedFunction) { let jsonMetadata = {}; if (reqOpts.json !== undefined) { - eventName = reqOpts.json.jobReference.jobId; + if (reqOpts.json.jobReference) { + eventName = reqOpts.json.jobReference.jobId; + } jsonMetadata = reqOpts.json; } else if (reqOpts.uri !== undefined) { // eslint-disable-next-line