Skip to content

Commit

Permalink
fix(webhooks): allow empty payload in webhook stage (#3589)
Browse files Browse the repository at this point in the history
  • Loading branch information
anotherchrisberry committed Apr 26, 2017
1 parent 58c18df commit 060b602
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {module, extend} from 'angular';
import {module} from 'angular';

import {JSON_UTILITY_SERVICE, JsonUtilityService} from 'core/utils/json/json.utility.service';
import {PIPELINE_CONFIG_PROVIDER} from 'core/pipeline/config/pipelineConfigProvider';
Expand Down Expand Up @@ -41,11 +41,7 @@ export class WebhookStage {
this.command.invalid = false;
this.command.errorMessage = '';
try {
const parsed = JSON.parse(this.command.payloadJSON);
if (!this.stage.payload) {
this.stage.payload = {};
}
extend(this.stage.payload, parsed);
this.stage.payload = this.command.payloadJSON ? JSON.parse(this.command.payloadJSON) : null;
} catch (e) {
this.command.invalid = true;
this.command.errorMessage = e.message;
Expand Down

0 comments on commit 060b602

Please sign in to comment.