Index: src/wp-admin/includes/template.php
===================================================================
--- src/wp-admin/includes/template.php	(revision 32991)
+++ src/wp-admin/includes/template.php	(working copy)
@@ -1276,9 +1276,10 @@
  *     @type string $class     CSS Class to be added to the `<tr>` element when the
  *                             field is output.
  * }
+ * @return true|WP_Error    Will return WP_Error if the page and section have not been defined, true otherwise.
  */
 function add_settings_field($id, $title, $callback, $page, $section = 'default', $args = array()) {
-	global $wp_settings_fields;
+	global $wp_settings_fields, $wp_settings_sections;
 
 	if ( 'misc' == $page ) {
 		_deprecated_argument( __FUNCTION__, '3.0', __( 'The miscellaneous options group has been removed. Use another settings group.' ) );
@@ -1290,7 +1291,26 @@
 		$page = 'reading';
 	}
 
-	$wp_settings_fields[$page][$section][$id] = array('id' => $id, 'title' => $title, 'callback' => $callback, 'args' => $args);
+	$built_in_pages_and_sections = array(
+		'discussion' => array( 'default', 'avatars' ),
+		'general'    => array( 'default' ),
+		'media'      => array( 'default', 'embeds', 'uploads' ),
+		'permalink'  => array( 'optional' ),
+		'reading'    => array( 'default' ),
+		'writing'    => array( 'default', 'remote_publishing', 'post_via_email' ),
+	);
+
+	// check the built-in pages and sections
+	$section_check = ! empty( $built_in_pages_and_sections[ $page ] ) && in_array( $section, $built_in_pages_and_sections[ $page ] );
+
+	if ( ! $section_check ) {
+		// check any sections added by add_settings_section
+		$section_check = ! empty( $wp_settings_sections[ $page ][ $section ] );
+	}
+
+	$wp_settings_fields[ $page ][ $section ][ $id ] = array( 'id' => $id, 'title' => $title, 'callback' => $callback, 'args' => $args );
+
+	return ! $section_check ? new WP_Error( 'invalid_settings_section', sprintf( __('Settings page \'%s\', section \'%s\' does not exist.'), $page, $section ) ) : $section_check;
 }
 
 /**
