{"action":"created","issue":{"url":"https://api.github.com/repos/owncloud/core/issues/16957","labels_url":"https://api.github.com/repos/owncloud/core/issues/16957/labels{/name}","comments_url":"https://api.github.com/repos/owncloud/core/issues/16957/comments","events_url":"https://api.github.com/repos/owncloud/core/issues/16957/events","html_url":"https://github.com/owncloud/core/pull/16957","id":88684259,"number":16957,"title":"Throw exception on `getPath` if file does not exist","user":{"login":"LukasReschke","id":878997,"avatar_url":"https://avatars.githubusercontent.com/u/878997?v=3","gravatar_id":"","url":"https://api.github.com/users/LukasReschke","html_url":"https://github.com/LukasReschke","followers_url":"https://api.github.com/users/LukasReschke/followers","following_url":"https://api.github.com/users/LukasReschke/following{/other_user}","gists_url":"https://api.github.com/users/LukasReschke/gists{/gist_id}","starred_url":"https://api.github.com/users/LukasReschke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LukasReschke/subscriptions","organizations_url":"https://api.github.com/users/LukasReschke/orgs","repos_url":"https://api.github.com/users/LukasReschke/repos","events_url":"https://api.github.com/users/LukasReschke/events{/privacy}","received_events_url":"https://api.github.com/users/LukasReschke/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/owncloud/core/labels/3%20-%20To%20Review","name":"3 - To Review","color":"ededed"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/owncloud/core/milestones/37","html_url":"https://github.com/owncloud/core/milestones/8.2-next","labels_url":"https://api.github.com/repos/owncloud/core/milestones/37/labels","id":993629,"number":37,"title":"8.2-next","description":"","creator":{"login":"craigpg","id":160667,"avatar_url":"https://avatars.githubusercontent.com/u/160667?v=3","gravatar_id":"","url":"https://api.github.com/users/craigpg","html_url":"https://github.com/craigpg","followers_url":"https://api.github.com/users/craigpg/followers","following_url":"https://api.github.com/users/craigpg/following{/other_user}","gists_url":"https://api.github.com/users/craigpg/gists{/gist_id}","starred_url":"https://api.github.com/users/craigpg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/craigpg/subscriptions","organizations_url":"https://api.github.com/users/craigpg/orgs","repos_url":"https://api.github.com/users/craigpg/repos","events_url":"https://api.github.com/users/craigpg/events{/privacy}","received_events_url":"https://api.github.com/users/craigpg/received_events","type":"User","site_admin":false},"open_issues":610,"closed_issues":70,"state":"open","created_at":"2015-02-24T16:19:37Z","updated_at":"2015-07-06T12:12:33Z","due_on":null,"closed_at":null},"comments":13,"created_at":"2015-06-16T10:17:14Z","updated_at":"2015-07-06T12:58:33Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/owncloud/core/pulls/16957","html_url":"https://github.com/owncloud/core/pull/16957","diff_url":"https://github.com/owncloud/core/pull/16957.diff","patch_url":"https://github.com/owncloud/core/pull/16957.patch"},"body":"Currently the `getPath` methods returned `NULL` in case when a file with the specified ID does not exist. This however mandates that developers are checking for the `NULL` case and if they do not the door for bugs with all kind of impact is widely opened.\r\n\r\nThis is especially harmful if used in context with Views where the final result is limited based on the result of `getPath`, if `getPath` returns `NULL` PHP type juggles this to an empty string resulting in all possible kind of bugs.\r\n\r\nWhile one could argue that this is a misusage of the API the fact is that it is very often misused and an exception will trigger an immediate stop of execution as well as log this behaviour and show a pretty error page.\r\n\r\nI also adjusted some usages where I believe that we need to catch these errors, in most cases this is though simply an error that should hard-fail.\r\n\r\n@icewind1991 @PVince81 @DeepDiver1975 Please review.\r\n@DeepDiver1975 Judge whether 8.1 or 8.2 - personally I'd go with 8.1 but this is rather high risk as it touches file system related stuff.\r\n\r\n<hr/>\r\n\r\nTodo:\r\n- [x] Fix ETag tests\r\n- [x] Fix sharing tests\r\n- [x] Fix trashbin tests\r\n- [x] Fix versioning tests\r\n\r\n(basically all relying on processing a `null` file) "},"comment":{"url":"https://api.github.com/repos/owncloud/core/issues/comments/118847754","html_url":"https://github.com/owncloud/core/pull/16957#issuecomment-118847754","issue_url":"https://api.github.com/repos/owncloud/core/issues/16957","id":118847754,"user":{"login":"PVince81","id":277525,"avatar_url":"https://avatars.githubusercontent.com/u/277525?v=3","gravatar_id":"","url":"https://api.github.com/users/PVince81","html_url":"https://github.com/PVince81","followers_url":"https://api.github.com/users/PVince81/followers","following_url":"https://api.github.com/users/PVince81/following{/other_user}","gists_url":"https://api.github.com/users/PVince81/gists{/gist_id}","starred_url":"https://api.github.com/users/PVince81/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PVince81/subscriptions","organizations_url":"https://api.github.com/users/PVince81/orgs","repos_url":"https://api.github.com/users/PVince81/repos","events_url":"https://api.github.com/users/PVince81/events{/privacy}","received_events_url":"https://api.github.com/users/PVince81/received_events","type":"User","site_admin":false},"created_at":"2015-07-06T12:58:33Z","updated_at":"2015-07-06T12:58:33Z","body":"Stuff still seem to work :+1: "}}