{"action":"created","issue":{"url":"https://api.github.com/repos/dukt/craft-like/issues/2","repository_url":"https://api.github.com/repos/dukt/craft-like","labels_url":"https://api.github.com/repos/dukt/craft-like/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/dukt/craft-like/issues/2/comments","events_url":"https://api.github.com/repos/dukt/craft-like/issues/2/events","html_url":"https://github.com/dukt/craft-like/issues/2","id":143243667,"number":2,"title":"getLikesByElementId doesn't check if $records exists before returning","user":{"login":"fyrebase","id":210659,"avatar_url":"https://avatars.githubusercontent.com/u/210659?v=3","gravatar_id":"","url":"https://api.github.com/users/fyrebase","html_url":"https://github.com/fyrebase","followers_url":"https://api.github.com/users/fyrebase/followers","following_url":"https://api.github.com/users/fyrebase/following{/other_user}","gists_url":"https://api.github.com/users/fyrebase/gists{/gist_id}","starred_url":"https://api.github.com/users/fyrebase/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fyrebase/subscriptions","organizations_url":"https://api.github.com/users/fyrebase/orgs","repos_url":"https://api.github.com/users/fyrebase/repos","events_url":"https://api.github.com/users/fyrebase/events{/privacy}","received_events_url":"https://api.github.com/users/fyrebase/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-03-24T13:23:54Z","updated_at":"2016-03-24T13:53:52Z","closed_at":"2016-03-24T13:53:52Z","body":"The `getLikesByElementId` method within `LikeService.php` doesn't check if `$records` exists before attempting to populate the model.\r\n\r\nLine 117 could be changed to something like the following returning a 0 count if no records are found.\r\n\r\n```\r\nif($records)\r\n{\r\n\treturn LikeModel::populateModels($records);\r\n}\r\nelse\r\n{\r\n\treturn 0;\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/dukt/craft-like/issues/comments/200845360","html_url":"https://github.com/dukt/craft-like/issues/2#issuecomment-200845360","issue_url":"https://api.github.com/repos/dukt/craft-like/issues/2","id":200845360,"user":{"login":"fyrebase","id":210659,"avatar_url":"https://avatars.githubusercontent.com/u/210659?v=3","gravatar_id":"","url":"https://api.github.com/users/fyrebase","html_url":"https://github.com/fyrebase","followers_url":"https://api.github.com/users/fyrebase/followers","following_url":"https://api.github.com/users/fyrebase/following{/other_user}","gists_url":"https://api.github.com/users/fyrebase/gists{/gist_id}","starred_url":"https://api.github.com/users/fyrebase/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fyrebase/subscriptions","organizations_url":"https://api.github.com/users/fyrebase/orgs","repos_url":"https://api.github.com/users/fyrebase/repos","events_url":"https://api.github.com/users/fyrebase/events{/privacy}","received_events_url":"https://api.github.com/users/fyrebase/received_events","type":"User","site_admin":false},"created_at":"2016-03-24T13:53:52Z","updated_at":"2016-03-24T13:53:52Z","body":"Please disregard. User error."}}