Attempting to edit post/page that doesn't exist doesn't generate an error message
|Reported by:||Viper007Bond||Owned by:|
post.php?action=edit&post=X (and it's page counterpart) doesn't check the entered ID to see if it exists. If a user edits the URL (or more likely bookmarks the URL for later editing) but the post ID doesn't exist (say it's deleted after bookmark), no pretty error message is displayed.
Instead, a blank edit form is displayed (such as the Write post screen) and on the edit post page, following error is displayed:
Warning: Attempt to assign property of non-object in [...]/wp-admin/edit-form-advanced.php on line 49
(for obvious reasons)
A simple fix is attached that should do the job.