Commit 476f2e06 authored by Stan Hu's avatar Stan Hu

Merge branch 'fix-nil-handling' into 'master'

Handle empty arguments case

`JSON.parse('')` results in an error, but `Oj.load('')` returns `nil`.

See merge request !6
parents 445dba15 b6159c24
......@@ -24,7 +24,7 @@ class MarketoTools < Sinatra::Base
params = {}
end
if params['event_name'] == 'user_create'
if params && params['event_name'] == 'user_create'
user = User.new(params)
client.createupdate_leads([user.to_param], lookup_field: :email)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment