Skip to content

Commit

Permalink
Bug fix for helloGCSGeneric() (#567)
Browse files Browse the repository at this point in the history
This function tried to reference 'event.context', which is 'undefined' when this function is triggered from a GCS change, causing helloGCSGeneric() to crash.
  • Loading branch information
ArieFish authored and JustinBeckwith committed Jun 8, 2018
1 parent 0accf6f commit 65f6908
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions functions/helloworld/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}`);
Expand Down

0 comments on commit 65f6908

Please sign in to comment.