diff --git a/core/modules/editor/editor.module b/core/modules/editor/editor.module
index ce3b9fa..d0fc351 100644
--- a/core/modules/editor/editor.module
+++ b/core/modules/editor/editor.module
@@ -412,12 +412,13 @@ function editor_entity_revision_delete(EntityInterface $entity) {
  */
 function _editor_record_file_usage(array $uuids, EntityInterface $entity) {
   foreach ($uuids as $uuid) {
-    $file = entity_load_by_uuid('file', $uuid);
-    if ($file->status !== FILE_STATUS_PERMANENT) {
-      $file->status = FILE_STATUS_PERMANENT;
-      $file->save();
+    if ($file = entity_load_by_uuid('file', $uuid)) {
+      if ($file->status !== FILE_STATUS_PERMANENT) {
+        $file->status = FILE_STATUS_PERMANENT;
+        $file->save();
+      }
+      \Drupal::service('file.usage')->add($file, 'editor', $entity->getEntityTypeId(), $entity->id());
     }
-    \Drupal::service('file.usage')->add($file, 'editor', $entity->getEntityTypeId(), $entity->id());
   }
 }
 
@@ -436,8 +437,9 @@ function _editor_record_file_usage(array $uuids, EntityInterface $entity) {
  */
 function _editor_delete_file_usage(array $uuids, EntityInterface $entity, $count) {
   foreach ($uuids as $uuid) {
-    $file = entity_load_by_uuid('file', $uuid);
-    \Drupal::service('file.usage')->delete($file, 'editor', $entity->getEntityTypeId(), $entity->id(), $count);
+    if ($file = entity_load_by_uuid('file', $uuid)) {
+      \Drupal::service('file.usage')->delete($file, 'editor', $entity->getEntityTypeId(), $entity->id(), $count);
+    }
   }
 }
 
diff --git a/core/modules/editor/src/Tests/EditorFileUsageTest.php b/core/modules/editor/src/Tests/EditorFileUsageTest.php
index 7c0ba3b..90c8eed 100644
--- a/core/modules/editor/src/Tests/EditorFileUsageTest.php
+++ b/core/modules/editor/src/Tests/EditorFileUsageTest.php
@@ -68,7 +68,7 @@ public function testEditorEntityHooks() {
       'type' => 'page',
       'title' => 'test',
       'body' => array(
-        'value' => '<p>Hello, world!</p><img src="awesome-llama.jpg" data-editor-file-uuid="' . $image->uuid() . '" />',
+        'value' => '<p>Hello, world!</p><img src="awesome-llama.jpg" data-editor-file-uuid="' . $image->uuid() . '" /><img src="awesome-llama.jpg" data-editor-file-uuid="invalid-editor-file-uuid-value" />',
         'format' => 'filtered_html',
       ),
       'uid' => 1,
