{"action":"opened","issue":{"url":"https://api.github.com/repos/karanmhatre/daily-art/issues/10","labels_url":"https://api.github.com/repos/karanmhatre/daily-art/issues/10/labels{/name}","comments_url":"https://api.github.com/repos/karanmhatre/daily-art/issues/10/comments","events_url":"https://api.github.com/repos/karanmhatre/daily-art/issues/10/events","html_url":"https://github.com/karanmhatre/daily-art/issues/10","id":55147581,"number":10,"title":"Error in User Profile page if no artwork has been uploaded","user":{"login":"alienware","id":2356208,"avatar_url":"https://avatars.githubusercontent.com/u/2356208?v=3","gravatar_id":"","url":"https://api.github.com/users/alienware","html_url":"https://github.com/alienware","followers_url":"https://api.github.com/users/alienware/followers","following_url":"https://api.github.com/users/alienware/following{/other_user}","gists_url":"https://api.github.com/users/alienware/gists{/gist_id}","starred_url":"https://api.github.com/users/alienware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alienware/subscriptions","organizations_url":"https://api.github.com/users/alienware/orgs","repos_url":"https://api.github.com/users/alienware/repos","events_url":"https://api.github.com/users/alienware/events{/privacy}","received_events_url":"https://api.github.com/users/alienware/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-01-22T12:28:54Z","updated_at":"2015-01-22T12:28:54Z","closed_at":null,"body":"My user ID is 17 and my [profile page](http://dailyart.in/users/17) is giving an error. Now, I know I'm not the ideal user on daily-art but I would atleast like to my profile to be up. :P\r\n\r\n```\r\npublic function show($id)\r\n\t{\r\n\t\t$user = User::find($id);\r\n\t\t$arts = $user->artworks;\r\n\t\t$arts_array = $user->artworks->toArray();\r\n\t\t$count = count($arts_array) < 3 ? count($arts_array) : 3;\r\n\t\t$random = rand(0, ($count-1));\r\n\t\treturn View::make('users.profile')->with(compact('arts','user', 'random', 'arts_array'));\r\n\t}\r\n```"}}