From 65f6908dbb36e07f21c4f3dc81c6961e8beac201 Mon Sep 17 00:00:00 2001 From: ArieFish <15861456+ArieFish@users.noreply.github.com> Date: Thu, 7 Jun 2018 20:35:39 -0400 Subject: [PATCH] Bug fix for helloGCSGeneric() (#567) This function tried to reference 'event.context', which is 'undefined' when this function is triggered from a GCS change, causing helloGCSGeneric() to crash. --- functions/helloworld/index.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/functions/helloworld/index.js b/functions/helloworld/index.js index 98807928ba..ab2851492c 100644 --- a/functions/helloworld/index.js +++ b/functions/helloworld/index.js @@ -107,10 +107,9 @@ exports.helloGCS = (event, callback) => { */ exports.helloGCSGeneric = (event, callback) => { const file = event.data; - const context = event.context; - console.log(`Event ${context.eventId}`); - console.log(` Event Type: ${context.eventType}`); + console.log(` Event ${event.eventId}`); + console.log(` Event Type: ${event.eventType}`); console.log(` Bucket: ${file.bucket}`); console.log(` File: ${file.name}`); console.log(` Metageneration: ${file.metageneration}`);