Index: src/wp-includes/class-wp-customize-setting.php
===================================================================
--- src/wp-includes/class-wp-customize-setting.php	(revision 39989)
+++ src/wp-includes/class-wp-customize-setting.php	(working copy)
@@ -587,7 +587,7 @@
 		$id_base = $this->id_data['base'];
 		if ( 'option' === $this->type ) {
 			return get_option( $id_base, $default );
-		} else if ( 'theme_mod' ) {
+		} elseif ( 'theme_mod' === $this->type ) {
 			return get_theme_mod( $id_base, $default );
 		} else {
 			/*
@@ -616,7 +616,7 @@
 				$autoload = self::$aggregated_multidimensionals[ $this->type ][ $this->id_data['base'] ]['autoload'];
 			}
 			return update_option( $id_base, $value, $autoload );
-		} else if ( 'theme_mod' ) {
+		} elseif ( 'theme_mod' === $this->type ) {
 			set_theme_mod( $id_base, $value );
 			return true;
 		} else {
Index: tests/phpunit/tests/customize/setting.php
===================================================================
--- tests/phpunit/tests/customize/setting.php	(revision 39989)
+++ tests/phpunit/tests/customize/setting.php	(working copy)
@@ -397,17 +397,24 @@

 		// Custom type that does not handle supplying the post value from the customize_value_{$id_base} filter.
 		$setting_id = 'custom_without_previewing_value_filter';
+
 		$setting = $this->manager->add_setting( $setting_id, array(
 			'type' => 'custom_preview_test',
 			'default' => 123,
 			'sanitize_callback' => array( $this->manager->nav_menus, 'intval_base10' ),
 		) );
+
+		// When #36952 occurs, get_theme_mod() will still return the default
+		// value if no theme mod exists. Add one to test that it isn't returned.
+		set_theme_mod( $setting_id, 999 );
 		$this->assertSame( 123, $setting->value() );
+
 		$this->manager->set_post_value( $setting_id, '456' );
 		$setting->preview();
 		$this->assertSame( 456, $setting->value() );

 		unset( $this->custom_type_data_previewed, $this->custom_type_data_saved );
+		remove_theme_mod( $setting_id );
 	}

 	/**
