{"action":"closed","number":3876,"pull_request":{"url":"https://api.github.com/repos/mautic/mautic/pulls/3876","id":116778704,"html_url":"https://github.com/mautic/mautic/pull/3876","diff_url":"https://github.com/mautic/mautic/pull/3876.diff","patch_url":"https://github.com/mautic/mautic/pull/3876.patch","issue_url":"https://api.github.com/repos/mautic/mautic/issues/3876","number":3876,"state":"closed","locked":false,"title":"Fix adding a contact to a company which does not exist","user":{"login":"escopecz","id":1235442,"avatar_url":"https://avatars1.githubusercontent.com/u/1235442?v=3","gravatar_id":"","url":"https://api.github.com/users/escopecz","html_url":"https://github.com/escopecz","followers_url":"https://api.github.com/users/escopecz/followers","following_url":"https://api.github.com/users/escopecz/following{/other_user}","gists_url":"https://api.github.com/users/escopecz/gists{/gist_id}","starred_url":"https://api.github.com/users/escopecz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/escopecz/subscriptions","organizations_url":"https://api.github.com/users/escopecz/orgs","repos_url":"https://api.github.com/users/escopecz/repos","events_url":"https://api.github.com/users/escopecz/events{/privacy}","received_events_url":"https://api.github.com/users/escopecz/received_events","type":"User","site_admin":false},"body":"\r\n[//]: # ( Please answer the following questions: )\r\n\r\n| Q  | A\r\n| --- | ---\r\n| Bug fix? | Y\r\n| New feature? | N\r\n| Related user documentation PR URL | /\r\n| Related developer documentation PR URL | /\r\n| Issues addressed (#s or URLs) | /\r\n| BC breaks? | N\r\n| Deprecations? | N\r\n\r\n[//]: # ( Note that all new features should have a related user and/or developer documentation PR in their respective repositories. )\r\n\r\n[//]: # ( Required: )\r\n#### Description:\r\nI got this error when I run the `app/console mautic:campaign:trigger` command:\r\n```\r\nSymfony\\Component\\Debug\\Exception\\FatalThrowableError: Call to a member function getId() on null (uncaught exception) at /Users/jan/dev/mautic/app/bundles/LeadBundle/Model/LeadModel.php line 2419 while running console command `mautic:campaigns:trigger`\r\n```\r\nThe error happened on this campaign:\r\n![screen shot 2017-04-20 at 15 59 34](https://cloud.githubusercontent.com/assets/1235442/25234477/6ffc764a-25e2-11e7-9825-3b7697ab0049.png)\r\n\r\nBased on the error and the code, the problem occurs when we try to add a contact to a company which does not exist and therefor the `$company` is `null`.\r\n\r\n[//]: # ( As applicable: )\r\n#### Steps to reproduce the bug:\r\n1. Create a campaign with __Add to company__ action\r\n2. Remove the company you selected in the action\r\n3. Run `app/console mautic:campaing:update` and `app/console mautic:campaing:trigger`\r\n- You should get the error\r\n\r\n#### Steps to test this PR:\r\n1. Apply this PR\r\n2. Run the command again. No error is thrown and all the campaigns are processed.\r\n","created_at":"2017-04-20T14:03:21Z","updated_at":"2017-05-05T19:03:24Z","closed_at":"2017-05-05T19:03:24Z","merged_at":"2017-05-05T19:03:24Z","merge_commit_sha":"0ea65d4a810f785d8d26a78b609cff34db391e81","assignee":{"login":"mqueme","id":1496976,"avatar_url":"https://avatars1.githubusercontent.com/u/1496976?v=3","gravatar_id":"","url":"https://api.github.com/users/mqueme","html_url":"https://github.com/mqueme","followers_url":"https://api.github.com/users/mqueme/followers","following_url":"https://api.github.com/users/mqueme/following{/other_user}","gists_url":"https://api.github.com/users/mqueme/gists{/gist_id}","starred_url":"https://api.github.com/users/mqueme/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mqueme/subscriptions","organizations_url":"https://api.github.com/users/mqueme/orgs","repos_url":"https://api.github.com/users/mqueme/repos","events_url":"https://api.github.com/users/mqueme/events{/privacy}","received_events_url":"https://api.github.com/users/mqueme/received_events","type":"User","site_admin":false},"assignees":[{"login":"dongilbert","id":718028,"avatar_url":"https://avatars1.githubusercontent.com/u/718028?v=3","gravatar_id":"","url":"https://api.github.com/users/dongilbert","html_url":"https://github.com/dongilbert","followers_url":"https://api.github.com/users/dongilbert/followers","following_url":"https://api.github.com/users/dongilbert/following{/other_user}","gists_url":"https://api.github.com/users/dongilbert/gists{/gist_id}","starred_url":"https://api.github.com/users/dongilbert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dongilbert/subscriptions","organizations_url":"https://api.github.com/users/dongilbert/orgs","repos_url":"https://api.github.com/users/dongilbert/repos","events_url":"https://api.github.com/users/dongilbert/events{/privacy}","received_events_url":"https://api.github.com/users/dongilbert/received_events","type":"User","site_admin":false},{"login":"mqueme","id":1496976,"avatar_url":"https://avatars1.githubusercontent.com/u/1496976?v=3","gravatar_id":"","url":"https://api.github.com/users/mqueme","html_url":"https://github.com/mqueme","followers_url":"https://api.github.com/users/mqueme/followers","following_url":"https://api.github.com/users/mqueme/following{/other_user}","gists_url":"https://api.github.com/users/mqueme/gists{/gist_id}","starred_url":"https://api.github.com/users/mqueme/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mqueme/subscriptions","organizations_url":"https://api.github.com/users/mqueme/orgs","repos_url":"https://api.github.com/users/mqueme/repos","events_url":"https://api.github.com/users/mqueme/events{/privacy}","received_events_url":"https://api.github.com/users/mqueme/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/mautic/mautic/milestones/31","html_url":"https://github.com/mautic/mautic/milestone/31","labels_url":"https://api.github.com/repos/mautic/mautic/milestones/31/labels","id":2484044,"number":31,"title":"2.8.1","description":"","creator":{"login":"dongilbert","id":718028,"avatar_url":"https://avatars1.githubusercontent.com/u/718028?v=3","gravatar_id":"","url":"https://api.github.com/users/dongilbert","html_url":"https://github.com/dongilbert","followers_url":"https://api.github.com/users/dongilbert/followers","following_url":"https://api.github.com/users/dongilbert/following{/other_user}","gists_url":"https://api.github.com/users/dongilbert/gists{/gist_id}","starred_url":"https://api.github.com/users/dongilbert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dongilbert/subscriptions","organizations_url":"https://api.github.com/users/dongilbert/orgs","repos_url":"https://api.github.com/users/dongilbert/repos","events_url":"https://api.github.com/users/dongilbert/events{/privacy}","received_events_url":"https://api.github.com/users/dongilbert/received_events","type":"User","site_admin":false},"open_issues":31,"closed_issues":15,"state":"open","created_at":"2017-04-26T15:57:32Z","updated_at":"2017-05-05T19:03:24Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/mautic/mautic/pulls/3876/commits","review_comments_url":"https://api.github.com/repos/mautic/mautic/pulls/3876/comments","review_comment_url":"https://api.github.com/repos/mautic/mautic/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mautic/mautic/issues/3876/comments","statuses_url":"https://api.github.com/repos/mautic/mautic/statuses/2cedf42485bd30d78b9f1dbe703fa28064e46a04","head":{"label":"escopecz:bug-add-to-deleted-company","ref":"bug-add-to-deleted-company","sha":"2cedf42485bd30d78b9f1dbe703fa28064e46a04","user":{"login":"escopecz","id":1235442,"avatar_url":"https://avatars1.githubusercontent.com/u/1235442?v=3","gravatar_id":"","url":"https://api.github.com/users/escopecz","html_url":"https://github.com/escopecz","followers_url":"https://api.github.com/users/escopecz/followers","following_url":"https://api.github.com/users/escopecz/following{/other_user}","gists_url":"https://api.github.com/users/escopecz/gists{/gist_id}","starred_url":"https://api.github.com/users/escopecz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/escopecz/subscriptions","organizations_url":"https://api.github.com/users/escopecz/orgs","repos_url":"https://api.github.com/users/escopecz/repos","events_url":"https://api.github.com/users/escopecz/events{/privacy}","received_events_url":"https://api.github.com/users/escopecz/received_events","type":"User","site_admin":false},"repo":{"id":31202004,"name":"mautic","full_name":"escopecz/mautic","owner":{"login":"escopecz","id":1235442,"avatar_url":"https://avatars1.githubusercontent.com/u/1235442?v=3","gravatar_id":"","url":"https://api.github.com/users/escopecz","html_url":"https://github.com/escopecz","followers_url":"https://api.github.com/users/escopecz/followers","following_url":"https://api.github.com/users/escopecz/following{/other_user}","gists_url":"https://api.github.com/users/escopecz/gists{/gist_id}","starred_url":"https://api.github.com/users/escopecz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/escopecz/subscriptions","organizations_url":"https://api.github.com/users/escopecz/orgs","repos_url":"https://api.github.com/users/escopecz/repos","events_url":"https://api.github.com/users/escopecz/events{/privacy}","received_events_url":"https://api.github.com/users/escopecz/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/escopecz/mautic","description":"Mautic: Open Source Marketing Automation Software.","fork":true,"url":"https://api.github.com/repos/escopecz/mautic","forks_url":"https://api.github.com/repos/escopecz/mautic/forks","keys_url":"https://api.github.com/repos/escopecz/mautic/keys{/key_id}","collaborators_url":"https://api.github.com/repos/escopecz/mautic/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/escopecz/mautic/teams","hooks_url":"https://api.github.com/repos/escopecz/mautic/hooks","issue_events_url":"https://api.github.com/repos/escopecz/mautic/issues/events{/number}","events_url":"https://api.github.com/repos/escopecz/mautic/events","assignees_url":"https://api.github.com/repos/escopecz/mautic/assignees{/user}","branches_url":"https://api.github.com/repos/escopecz/mautic/branches{/branch}","tags_url":"https://api.github.com/repos/escopecz/mautic/tags","blobs_url":"https://api.github.com/repos/escopecz/mautic/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/escopecz/mautic/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/escopecz/mautic/git/refs{/sha}","trees_url":"https://api.github.com/repos/escopecz/mautic/git/trees{/sha}","statuses_url":"https://api.github.com/repos/escopecz/mautic/statuses/{sha}","languages_url":"https://api.github.com/repos/escopecz/mautic/languages","stargazers_url":"https://api.github.com/repos/escopecz/mautic/stargazers","contributors_url":"https://api.github.com/repos/escopecz/mautic/contributors","subscribers_url":"https://api.github.com/repos/escopecz/mautic/subscribers","subscription_url":"https://api.github.com/repos/escopecz/mautic/subscription","commits_url":"https://api.github.com/repos/escopecz/mautic/commits{/sha}","git_commits_url":"https://api.github.com/repos/escopecz/mautic/git/commits{/sha}","comments_url":"https://api.github.com/repos/escopecz/mautic/comments{/number}","issue_comment_url":"https://api.github.com/repos/escopecz/mautic/issues/comments{/number}","contents_url":"https://api.github.com/repos/escopecz/mautic/contents/{+path}","compare_url":"https://api.github.com/repos/escopecz/mautic/compare/{base}...{head}","merges_url":"https://api.github.com/repos/escopecz/mautic/merges","archive_url":"https://api.github.com/repos/escopecz/mautic/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/escopecz/mautic/downloads","issues_url":"https://api.github.com/repos/escopecz/mautic/issues{/number}","pulls_url":"https://api.github.com/repos/escopecz/mautic/pulls{/number}","milestones_url":"https://api.github.com/repos/escopecz/mautic/milestones{/number}","notifications_url":"https://api.github.com/repos/escopecz/mautic/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/escopecz/mautic/labels{/name}","releases_url":"https://api.github.com/repos/escopecz/mautic/releases{/id}","deployments_url":"https://api.github.com/repos/escopecz/mautic/deployments","created_at":"2015-02-23T09:52:24Z","updated_at":"2015-03-09T14:56:38Z","pushed_at":"2017-05-03T14:56:42Z","git_url":"git://github.com/escopecz/mautic.git","ssh_url":"git@github.com:escopecz/mautic.git","clone_url":"https://github.com/escopecz/mautic.git","svn_url":"https://github.com/escopecz/mautic","homepage":"http://mautic.org","size":68047,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mautic:staging","ref":"staging","sha":"d0d5f71649328b4320c288db79caeb69ddbb9bfc","user":{"login":"mautic","id":5257677,"avatar_url":"https://avatars3.githubusercontent.com/u/5257677?v=3","gravatar_id":"","url":"https://api.github.com/users/mautic","html_url":"https://github.com/mautic","followers_url":"https://api.github.com/users/mautic/followers","following_url":"https://api.github.com/users/mautic/following{/other_user}","gists_url":"https://api.github.com/users/mautic/gists{/gist_id}","starred_url":"https://api.github.com/users/mautic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mautic/subscriptions","organizations_url":"https://api.github.com/users/mautic/orgs","repos_url":"https://api.github.com/users/mautic/repos","events_url":"https://api.github.com/users/mautic/events{/privacy}","received_events_url":"https://api.github.com/users/mautic/received_events","type":"Organization","site_admin":false},"repo":{"id":12204147,"name":"mautic","full_name":"mautic/mautic","owner":{"login":"mautic","id":5257677,"avatar_url":"https://avatars3.githubusercontent.com/u/5257677?v=3","gravatar_id":"","url":"https://api.github.com/users/mautic","html_url":"https://github.com/mautic","followers_url":"https://api.github.com/users/mautic/followers","following_url":"https://api.github.com/users/mautic/following{/other_user}","gists_url":"https://api.github.com/users/mautic/gists{/gist_id}","starred_url":"https://api.github.com/users/mautic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mautic/subscriptions","organizations_url":"https://api.github.com/users/mautic/orgs","repos_url":"https://api.github.com/users/mautic/repos","events_url":"https://api.github.com/users/mautic/events{/privacy}","received_events_url":"https://api.github.com/users/mautic/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mautic/mautic","description":"Mautic: Open Source Marketing Automation Software.","fork":false,"url":"https://api.github.com/repos/mautic/mautic","forks_url":"https://api.github.com/repos/mautic/mautic/forks","keys_url":"https://api.github.com/repos/mautic/mautic/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mautic/mautic/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mautic/mautic/teams","hooks_url":"https://api.github.com/repos/mautic/mautic/hooks","issue_events_url":"https://api.github.com/repos/mautic/mautic/issues/events{/number}","events_url":"https://api.github.com/repos/mautic/mautic/events","assignees_url":"https://api.github.com/repos/mautic/mautic/assignees{/user}","branches_url":"https://api.github.com/repos/mautic/mautic/branches{/branch}","tags_url":"https://api.github.com/repos/mautic/mautic/tags","blobs_url":"https://api.github.com/repos/mautic/mautic/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mautic/mautic/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mautic/mautic/git/refs{/sha}","trees_url":"https://api.github.com/repos/mautic/mautic/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mautic/mautic/statuses/{sha}","languages_url":"https://api.github.com/repos/mautic/mautic/languages","stargazers_url":"https://api.github.com/repos/mautic/mautic/stargazers","contributors_url":"https://api.github.com/repos/mautic/mautic/contributors","subscribers_url":"https://api.github.com/repos/mautic/mautic/subscribers","subscription_url":"https://api.github.com/repos/mautic/mautic/subscription","commits_url":"https://api.github.com/repos/mautic/mautic/commits{/sha}","git_commits_url":"https://api.github.com/repos/mautic/mautic/git/commits{/sha}","comments_url":"https://api.github.com/repos/mautic/mautic/comments{/number}","issue_comment_url":"https://api.github.com/repos/mautic/mautic/issues/comments{/number}","contents_url":"https://api.github.com/repos/mautic/mautic/contents/{+path}","compare_url":"https://api.github.com/repos/mautic/mautic/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mautic/mautic/merges","archive_url":"https://api.github.com/repos/mautic/mautic/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mautic/mautic/downloads","issues_url":"https://api.github.com/repos/mautic/mautic/issues{/number}","pulls_url":"https://api.github.com/repos/mautic/mautic/pulls{/number}","milestones_url":"https://api.github.com/repos/mautic/mautic/milestones{/number}","notifications_url":"https://api.github.com/repos/mautic/mautic/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mautic/mautic/labels{/name}","releases_url":"https://api.github.com/repos/mautic/mautic/releases{/id}","deployments_url":"https://api.github.com/repos/mautic/mautic/deployments","created_at":"2013-08-19T00:36:28Z","updated_at":"2017-05-05T18:02:31Z","pushed_at":"2017-05-05T19:03:24Z","git_url":"git://github.com/mautic/mautic.git","ssh_url":"git@github.com:mautic/mautic.git","clone_url":"https://github.com/mautic/mautic.git","svn_url":"https://github.com/mautic/mautic","homepage":"https://www.mautic.org","size":67872,"stargazers_count":1574,"watchers_count":1574,"language":"PHP","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":555,"mirror_url":null,"open_issues_count":933,"forks":555,"open_issues":933,"watchers":1574,"default_branch":"staging"}},"_links":{"self":{"href":"https://api.github.com/repos/mautic/mautic/pulls/3876"},"html":{"href":"https://github.com/mautic/mautic/pull/3876"},"issue":{"href":"https://api.github.com/repos/mautic/mautic/issues/3876"},"comments":{"href":"https://api.github.com/repos/mautic/mautic/issues/3876/comments"},"review_comments":{"href":"https://api.github.com/repos/mautic/mautic/pulls/3876/comments"},"review_comment":{"href":"https://api.github.com/repos/mautic/mautic/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mautic/mautic/pulls/3876/commits"},"statuses":{"href":"https://api.github.com/repos/mautic/mautic/statuses/2cedf42485bd30d78b9f1dbe703fa28064e46a04"}},"merged":true,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":{"login":"dongilbert","id":718028,"avatar_url":"https://avatars1.githubusercontent.com/u/718028?v=3","gravatar_id":"","url":"https://api.github.com/users/dongilbert","html_url":"https://github.com/dongilbert","followers_url":"https://api.github.com/users/dongilbert/followers","following_url":"https://api.github.com/users/dongilbert/following{/other_user}","gists_url":"https://api.github.com/users/dongilbert/gists{/gist_id}","starred_url":"https://api.github.com/users/dongilbert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dongilbert/subscriptions","organizations_url":"https://api.github.com/users/dongilbert/orgs","repos_url":"https://api.github.com/users/dongilbert/repos","events_url":"https://api.github.com/users/dongilbert/events{/privacy}","received_events_url":"https://api.github.com/users/dongilbert/received_events","type":"User","site_admin":false},"comments":2,"review_comments":0,"maintainer_can_modify":false,"commits":1,"additions":5,"deletions":0,"changed_files":1}}
{"actor":{"display_login":"dongilbert"}}