From a6a2f164af8a3b3f445a0c97f4493ef7bee4df01 Mon Sep 17 00:00:00 2001 From: Egor Kislitsyn Date: Thu, 14 Apr 2016 21:06:04 +0700 Subject: [PATCH] don't overwrite the `event.data.event` if it exists already --- lib/actions/FunctionRun.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/actions/FunctionRun.js b/lib/actions/FunctionRun.js index 4459ca3c2..6ad1714ea 100644 --- a/lib/actions/FunctionRun.js +++ b/lib/actions/FunctionRun.js @@ -119,6 +119,9 @@ module.exports = function(S) { // Missing function if (!this.function) return BbPromise.reject(new SError(`Function ${this.evt.options.name} does not exist in your project.`)); + // load event data if not it not present already + if (this.evt.data.event) return BbPromise.resolve(); + return this._getEventFromStdIn() .then(event => event || S.utils.readFile(this.function.getRootPath('event.json'))) .then(event => this.evt.data.event = event);