Index: wp-includes/capabilities.php
===================================================================
--- wp-includes/capabilities.php	(revision 22318)
+++ wp-includes/capabilities.php	(working copy)
@@ -1073,7 +1073,10 @@
 		}
 
 		$post_type = get_post_type_object( $post->post_type );
-
+		if ( is_null( $post_type ) ) {
+			$caps[] = 'do_not_allow';
+			break;
+		}
 		if ( ! $post_type->map_meta_cap ) {
 			$caps[] = $post_type->cap->$cap;
 			// Prior to 3.1 we would re-call map_meta_cap here.
