diff --git a/core/lib/Drupal/Core/Site/Settings.php b/core/lib/Drupal/Core/Site/Settings.php
index 39a7e5a..adef2ba 100644
--- a/core/lib/Drupal/Core/Site/Settings.php
+++ b/core/lib/Drupal/Core/Site/Settings.php
@@ -24,7 +24,7 @@
    *
    * @var \Drupal\Core\Site\Settings
    */
-  private static $instance;
+  private static $instance = NULL;
 
   /**
    * Constructor.
@@ -44,8 +44,14 @@ public function __construct(array $settings) {
    * available.
    *
    * @return \Drupal\Core\Site\Settings
+   *
+   * @throws \BadMethodCallException
+   *  Thrown when the settings instance has not been initialized yet.
    */
   public static function getInstance() {
+    if (self::$instance === NULL) {
+      throw new \BadMethodCallException('Settings::$instance is not initialized yet. Call Settings::initialize() first.');
+    }
     return self::$instance;
   }
 
diff --git a/core/tests/Drupal/Tests/Core/Site/SettingsTest.php b/core/tests/Drupal/Tests/Core/Site/SettingsTest.php
index 3cf50fc..3b6eb65 100644
--- a/core/tests/Drupal/Tests/Core/Site/SettingsTest.php
+++ b/core/tests/Drupal/Tests/Core/Site/SettingsTest.php
@@ -126,4 +126,21 @@ public function testGetApcuPrefix() {
     $this->assertNotEquals($settings::getApcuPrefix('cache_test', '/test/a'), $settings::getApcuPrefix('cache_test', '/test/b'));
   }
 
+  /**
+   * Tests that an exception is thrown when settings are not initialized yet.
+   *
+   * @covers ::getInstance
+   */
+  public function testGetInstanceReflection() {
+    $settings = new Settings(array());
+
+    $class = new \ReflectionClass(Settings::class);
+    $instace_property = $class->getProperty("instance");
+    $instace_property->setAccessible(TRUE);
+    $instace_property->setValue(NULL);
+
+    $this->setExpectedException(\BadMethodCallException::class);
+    $settings->getInstance();
+  }
+
 }
