diff --git a/core/lib/Drupal/Core/Config/ConfigManager.php b/core/lib/Drupal/Core/Config/ConfigManager.php
index fb8f658..3d6c50f 100644
--- a/core/lib/Drupal/Core/Config/ConfigManager.php
+++ b/core/lib/Drupal/Core/Config/ConfigManager.php
@@ -458,7 +458,7 @@ public function findMissingContentDependencies() {
     foreach (array_unique($content_dependencies) as $content_dependency) {
       // Format of the dependency is entity_type:bundle:uuid.
       list($entity_type, $bundle, $uuid) = explode(':', $content_dependency, 3);
-      if (!$this->entityManager->loadEntityByUuid($entity_type, $uuid)) {
+      if (!$this->entityManager->loadEntityByConfigTarget($entity_type, $uuid)) {
         $missing_dependencies[$uuid] = array(
           'entity_type' => $entity_type,
           'bundle' => $bundle,
diff --git a/core/lib/Drupal/Core/Entity/EntityManager.php b/core/lib/Drupal/Core/Entity/EntityManager.php
index 42e475a..f7bb8f0 100644
--- a/core/lib/Drupal/Core/Entity/EntityManager.php
+++ b/core/lib/Drupal/Core/Entity/EntityManager.php
@@ -10,9 +10,11 @@
 use Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException;
 use Drupal\Component\Plugin\Exception\PluginNotFoundException;
 use Drupal\Component\Utility\SafeMarkup;
+use Drupal\Component\Uuid\Uuid;
 use Drupal\Core\Cache\Cache;
 use Drupal\Core\Cache\CacheBackendInterface;
 use Drupal\Core\Config\Entity\ConfigEntityType;
+use Drupal\Core\Database\InvalidQueryException;
 use Drupal\Core\DependencyInjection\ClassResolverInterface;
 use Drupal\Core\Entity\Exception\AmbiguousEntityClassException;
 use Drupal\Core\Entity\Exception\NoCorrespondingEntityClassException;
@@ -1120,15 +1122,26 @@ protected function getDisplayModeOptions($display_type, $entity_type_id, $includ
    * {@inheritdoc}
    */
   public function loadEntityByUuid($entity_type_id, $uuid) {
+    // Throw InvalidQueryException for invalid UUIDs.
+    // @todo: Remove this check if we adopt validation constraints for UUIDs at
+    // another layer of the query.
+    // @see https://www.drupal.org/node/1805576
+    // @see https://www.drupal.org/node/2491989
+    if (empty($uuid) || !is_string($uuid) || !Uuid::isValid($uuid)) {
+      throw new InvalidQueryException('Invalid UUID: ' . print_r($uuid, TRUE));
+    }
+    // Make sure the entity definition includes UUIDs.
     $entity_type = $this->getDefinition($entity_type_id);
-
     if (!$uuid_key = $entity_type->getKey('uuid')) {
       throw new EntityStorageException("Entity type $entity_type_id does not support UUIDs.");
     }
-
+    // Perform the query.
     $entities = $this->getStorage($entity_type_id)->loadByProperties(array($uuid_key => $uuid));
-
-    return reset($entities);
+    // Return the result if there is one.
+    if (!empty($entities)) {
+      return reset($entities);
+    }
+    return NULL;
   }
 
   /**
@@ -1147,7 +1160,12 @@ public function loadEntityByConfigTarget($entity_type_id, $target) {
 
     // For content entities, the config target is given by the UUID.
     else {
-      $entity = $this->loadEntityByUuid($entity_type_id, $target);
+      try {
+        $entity = $this->loadEntityByUuid($entity_type_id, $target);
+      }
+      catch (InvalidQueryException $e) {
+        $entity = NULL;
+      }
     }
 
     return $entity;
diff --git a/core/lib/Drupal/Core/Entity/EntityManagerInterface.php b/core/lib/Drupal/Core/Entity/EntityManagerInterface.php
index 7b180d2..bd77a11 100644
--- a/core/lib/Drupal/Core/Entity/EntityManagerInterface.php
+++ b/core/lib/Drupal/Core/Entity/EntityManagerInterface.php
@@ -466,6 +466,8 @@ public function getFormModeOptions($entity_type_id, $include_disabled = FALSE);
    * @return \Drupal\Core\Entity\EntityInterface|null
    *   The entity object, or NULL if there is no entity with the given UUID.
    *
+   * @throws \Drupal\Core\Database\InvalidQueryException
+   *   Thrown when the UUID is malformed.
    * @throws \Drupal\Core\Entity\EntityStorageException
    *   Thrown in case the requested entity type does not support UUIDs.
    */
diff --git a/core/modules/editor/src/Tests/EditorFileReferenceFilterTest.php b/core/modules/editor/src/Tests/EditorFileReferenceFilterTest.php
index 87809ef..1205650 100644
--- a/core/modules/editor/src/Tests/EditorFileReferenceFilterTest.php
+++ b/core/modules/editor/src/Tests/EditorFileReferenceFilterTest.php
@@ -96,11 +96,15 @@ function testEditorFileReferenceFilter() {
     $this->assertIdentical($input, $output->getProcessedText());
     $this->assertEqual($cache_tag, $output->getCacheTags());
 
+    /**
+     * @todo: Determine how to treat queries for invalid UUIDs.
+     * @see https://www.drupal.org/node/2403271
     $this->pass('One data-entity-uuid attribute with an invalid value.');
     $input = '<img src="llama.jpg" data-entity-type="file" data-entity-uuid="invalid-' . $uuid . '" />';
     $output = $test($input);
     $this->assertIdentical($input, $output->getProcessedText());
     $this->assertEqual(array(), $output->getCacheTags());
+    */
 
     $this->pass('Two different data-entity-uuid attributes.');
     $input = '<img src="llama.jpg" data-entity-type="file" data-entity-uuid="' . $uuid . '" />';
diff --git a/core/modules/editor/src/Tests/EditorFileUsageTest.php b/core/modules/editor/src/Tests/EditorFileUsageTest.php
index 7b5210e..926228e 100644
--- a/core/modules/editor/src/Tests/EditorFileUsageTest.php
+++ b/core/modules/editor/src/Tests/EditorFileUsageTest.php
@@ -65,7 +65,9 @@ public function testEditorEntityHooks() {
 
     $body_value = '<p>Hello, world!</p><img src="awesome-llama.jpg" data-entity-type="file" data-entity-uuid="' . $image->uuid() . '" />';
     // Test handling of an invalid data-entity-uuid attribute.
-    $body_value .= '<img src="awesome-llama.jpg" data-entity-type="file" data-entity-uuid="invalid-entity-uuid-value" />';
+    // @todo: Determine how to change this test for invalid UUIDs.
+    // @see https://www.drupal.org/node/2403271
+    // $body_value .= '<img src="awesome-llama.jpg" data-entity-type="file" data-entity-uuid="invalid-entity-uuid-value" />';
     // Test handling of an invalid data-entity-type attribute.
     $body_value .= '<img src="awesome-llama.jpg" data-entity-type="invalid-entity-type-value" data-entity-uuid="' . $image->uuid() . '" />';
     // Test handling of a non-existing UUID.
diff --git a/core/modules/image/src/Tests/ImageFieldDefaultImagesTest.php b/core/modules/image/src/Tests/ImageFieldDefaultImagesTest.php
index e541c27..8748571 100644
--- a/core/modules/image/src/Tests/ImageFieldDefaultImagesTest.php
+++ b/core/modules/image/src/Tests/ImageFieldDefaultImagesTest.php
@@ -317,7 +317,7 @@ public function testInvalidDefaultImage() {
       'type' => 'image',
       'settings' => array(
         'default_image' => array(
-          'uuid' => 100000,
+          'uuid' => $this->container->get('uuid')->generate(),
         )
       ),
     ));
@@ -332,7 +332,7 @@ public function testInvalidDefaultImage() {
       'label' => $this->randomMachineName(),
       'settings' => array(
         'default_image' => array(
-          'uuid' => 100000,
+          'uuid' => $this->container->get('uuid')->generate(),
         )
       ),
     ));
diff --git a/core/modules/system/src/Tests/Entity/EntityUUIDTest.php b/core/modules/system/src/Tests/Entity/EntityUUIDTest.php
index 48a6e4e..e1b3c40 100644
--- a/core/modules/system/src/Tests/Entity/EntityUUIDTest.php
+++ b/core/modules/system/src/Tests/Entity/EntityUUIDTest.php
@@ -100,5 +100,11 @@ protected function assertCRUD($entity_type) {
     }
     $entity_duplicate->save();
     $this->assertNotEqual($entity->id(), $entity_duplicate->id());
+
+    // Verify that \Drupal::entityManager()->loadEntityByUuid() returns NULL
+    // for a non-existent UUID.
+    $non_existent_uuid = \Drupal::service('uuid')->generate();
+    $non_existent_entity = \Drupal::entityManager()->loadEntityByUuid($entity_type, $non_existent_uuid);
+    $this->assertNull($non_existent_entity);
   }
 }
diff --git a/core/tests/Drupal/Tests/Component/Uuid/UuidTest.php b/core/tests/Drupal/Tests/Component/Uuid/UuidTest.php
index 353c352..074a78e 100644
--- a/core/tests/Drupal/Tests/Component/Uuid/UuidTest.php
+++ b/core/tests/Drupal/Tests/Component/Uuid/UuidTest.php
@@ -96,6 +96,7 @@ public function providerTestValidation() {
       // These are invalid UUIDs.
       array('0ab26e6b-f074-4e44-9da-601205fa0e976', FALSE, 'Invalid format was validated'),
       array('0ab26e6b-f074-4e44-9daf-1205fa0e9761f', FALSE, 'Invalid length was validated'),
+      array(NULL, FALSE, 'NULL UUID was validated'),
     );
   }
 }
diff --git a/core/tests/Drupal/Tests/Core/Entity/EntityManagerTest.php b/core/tests/Drupal/Tests/Core/Entity/EntityManagerTest.php
index 11b7ced..c982619 100644
--- a/core/tests/Drupal/Tests/Core/Entity/EntityManagerTest.php
+++ b/core/tests/Drupal/Tests/Core/Entity/EntityManagerTest.php
@@ -10,6 +10,7 @@
 use Drupal\Component\Plugin\Discovery\DiscoveryInterface;
 use Drupal\Component\Plugin\Exception\PluginNotFoundException;
 use Drupal\Core\Config\Entity\ConfigEntityStorage;
+use Drupal\Core\Database\InvalidQueryException;
 use Drupal\Core\DependencyInjection\ContainerInjectionInterface;
 use Drupal\Core\Entity\ContentEntityInterface;
 use Drupal\Core\Entity\EntityHandlerBase;
@@ -1818,6 +1819,215 @@ protected function getTestHandlerClass() {
     return get_class($this->getMockForAbstractClass('Drupal\Core\Entity\EntityHandlerBase'));
   }
 
+  /**
+   * Provides test data for testloadEntityByUuid() and its friends.
+   *
+   * @return array
+   *   - An entity type ID.
+   *   - A UUID.
+   */
+  public function providerLoadEntityByUuid() {
+    return array(
+      array('apple', '6d286553-59ae-409a-887d-ee75df67b834'),
+    );
+  }
+
+  /**
+   * Tests loadEntityByUuid() for UUIDs which are supported and exist.
+   *
+   * @covers ::loadEntityByUuid
+   *
+   * @dataProvider providerLoadEntityByUuid
+   */
+  public function testloadEntityByUuid($entity_type_id, $uuid) {
+    // Mock the entity type.
+    $entity_type = $this->getMockBuilder('Drupal\Core\Entity\EntityTypeInterface')
+      ->setMethods(['getKey'])
+      ->getMockForAbstractClass();
+    $entity_type->expects($this->once())
+      ->method('getKey')
+      ->with('uuid')
+      ->willReturn('uuid');
+
+    // Mock the entity storage.
+    $entity_storage = $this->getMockBuilder('Drupal\Core\Entity\EntityStorageInterface')
+      ->setMethods(['loadByProperties'])
+      ->getMockForAbstractClass();
+    // Have loadByProperties() return an array with a single string which we
+    // construct.
+    $entity_storage->expects($this->once())
+      ->method('loadByProperties')
+      ->willReturn(['this entity contains uuid: ' . $uuid]);
+
+    // Mock the manager.
+    $manager = $this->getMockBuilder('Drupal\Core\Entity\EntityManager')
+      ->setMethods(['getDefinition', 'getStorage'])
+      ->disableOriginalConstructor()
+      ->getMock();
+    $manager->expects($this->once())
+      ->method('getDefinition')
+      ->willReturn($entity_type);
+    $manager->expects($this->once())
+      ->method('getStorage')
+      ->with($entity_type_id)
+      ->willReturn($entity_storage);
+
+    $this->assertEquals(
+      'this entity contains uuid: ' . $uuid,
+      $manager->loadEntityByUuid($entity_type_id, $uuid)
+    );
+  }
+
+  /**
+   * Tests loadEntityByUuid() for UUIDs which don't exist in the database.
+   *
+   * Verifes that when
+   * Drupal\Core\Entity\EntityStorageInterface::loadByProperties() returns an
+   * empty array, loadEntityByUuid() returns NULL.
+   *
+   * @covers ::loadEntityByUuid
+   *
+   * @dataProvider providerLoadEntityByUuid
+   */
+  public function testloadEntityByUuidDoesNotExist($entity_type_id, $uuid) {
+    // Mock the entity type.
+    $entity_type = $this->getMockBuilder('Drupal\Core\Entity\EntityTypeInterface')
+      ->setMethods(['getKey'])
+      ->getMockForAbstractClass();
+    $entity_type->expects($this->once())
+      ->method('getKey')
+      ->with('uuid')
+      ->willReturn('uuid');
+
+    // Mock the entity storage.
+    $entity_storage = $this->getMockBuilder('Drupal\Core\Entity\EntityStorageInterface')
+      ->setMethods(['loadByProperties'])
+      ->getMockForAbstractClass();
+    // Make sure we return an empty array of entities.
+    $entity_storage->expects($this->once())
+      ->method('loadByProperties')
+      ->willReturn([]);
+
+    // Mock the manager.
+    $manager = $this->getMockBuilder('Drupal\Core\Entity\EntityManager')
+      ->setMethods(['getDefinition', 'getStorage'])
+      ->disableOriginalConstructor()
+      ->getMock();
+    $manager->expects($this->once())
+      ->method('getDefinition')
+      ->willReturn($entity_type);
+    $manager->expects($this->once())
+      ->method('getStorage')
+      ->with($entity_type_id)
+      ->willReturn($entity_storage);
+
+    $this->assertNull($manager->loadEntityByUuid($entity_type_id, $uuid));
+  }
+
+  /**
+   * Tests loadEntityByUuid() where UUIDs are not supported.
+   *
+   * Verify that loadEntityByUuid() throws a
+   * Drupal\Core\Entity\EntityStorageException if the entity type does not
+   * support UUIDs.
+   *
+   * @covers ::loadEntityByUuid
+   *
+   * @expectedException \Drupal\Core\Entity\EntityStorageException
+   *
+   * @dataProvider providerLoadEntityByUuid
+   *
+   * @see \Drupal\Core\Entity\EntityTypeInterface::getKey()
+   */
+  public function testloadEntityByUuidNotSupported($entity_type_id, $uuid) {
+    // Mock the entity type.
+    $entity_type = $this->getMockBuilder('Drupal\Core\Entity\EntityTypeInterface')
+      ->setMethods(['getKey'])
+      ->getMockForAbstractClass();
+    // Make sure that the UUID key does not exist.
+    $entity_type->expects($this->once())
+      ->method('getKey')
+      ->with('uuid')
+      ->willReturn(FALSE);
+
+    // Mock the manager.
+    $manager = $this->getMockBuilder('Drupal\Core\Entity\EntityManager')
+      ->setMethods(['getDefinition', 'getStorage'])
+      ->disableOriginalConstructor()
+      ->getMock();
+    $manager->expects($this->once())
+      ->method('getDefinition')
+      ->willReturn($entity_type);
+    $manager->expects($this->never())
+      ->method('getStorage');
+
+    // We don't make an assertion here because we're expecting an exception.
+    $manager->loadEntityByUuid($entity_type_id, $uuid);
+  }
+
+  /**
+   * Data provider for testloadEntityByUuidBadUuid().
+   *
+   * @return array
+   *   - Entity type.
+   *   - Malformed UUID.
+   *
+   * @see \Drupal\Tests\Component\Uuid\UuidTest::providerTestValidation()
+   */
+  public function providerLoadEntityByUuidBadUuid() {
+    return [
+      ['type', '0ab26e6b-f074-4e44-9da-601205fa0e976'],
+      ['type', '0ab26e6b-f074-4e44-9daf-1205fa0e9761f'],
+      ['type', NULL],
+      ['type', 23],
+      ['type', []],
+      ['type', ['not empty array']],
+    ];
+  }
+
+  /**
+   * Test that loadEntityByUuid() throws InvalidQueryException for bad UUIDs.
+   *
+   * @covers ::loadEntityByUuid
+   *
+   * @expectedException \Drupal\Core\Database\InvalidQueryException
+   *
+   * @dataProvider providerLoadEntityByUuidBadUuid
+   */
+  public function testloadEntityByUuidBadUuid($entity_type_id, $bad_uuid) {
+    // Mock the entity type.
+    $entity_type = $this->getMockBuilder('Drupal\Core\Entity\EntityTypeInterface')
+      ->setMethods(['getKey'])
+      ->getMockForAbstractClass();
+    $entity_type->expects($this->never())
+      ->method('getKey');
+
+    // Mock the entity storage.
+    $entity_storage = $this->getMockBuilder('Drupal\Core\Entity\EntityStorageInterface')
+      ->setMethods(['loadByProperties'])
+      ->getMockForAbstractClass();
+    // Make sure we return a non-NULL mock entity, even though it will never be
+    // called.
+    $entity_storage->expects($this->never())
+      ->method('loadByProperties')
+      ->willReturn(['I am an entity.']);
+
+    // Mock the manager.
+    $manager = $this->getMockBuilder('Drupal\Core\Entity\EntityManager')
+      ->setMethods(['getDefinition', 'getStorage'])
+      ->disableOriginalConstructor()
+      ->getMock();
+    $manager->expects($this->never())
+      ->method('getDefinition')
+      ->willReturn($entity_type);
+    $manager->expects($this->never())
+      ->method('getStorage')
+      ->with($entity_type_id)
+      ->willReturn($entity_storage);
+
+    $manager->loadEntityByUuid($entity_type_id, $bad_uuid);
+  }
+
 }
 
 /*
