diff --git a/src/YamlFormSubmissionStorage.php b/src/YamlFormSubmissionStorage.php
index 28cfd91..e67ad06 100644
--- a/src/YamlFormSubmissionStorage.php
+++ b/src/YamlFormSubmissionStorage.php
@@ -49,8 +49,8 @@ class YamlFormSubmissionStorage extends SqlContentEntityStorage implements YamlF
       $query->condition('entity_id', $source_entity->id());
     }
     else {
-      $query->condition('entity_type', NULL, 'IS');
-      $query->condition('entity_id', NULL, 'IS');
+      $query->notExists('entity_type');
+      $query->notExists('entity_id');
     }
     if ($entity_ids = $query->execute()) {
       return $this->load(reset($entity_ids));
@@ -73,8 +73,8 @@ class YamlFormSubmissionStorage extends SqlContentEntityStorage implements YamlF
       $query->condition('entity_id', $source_entity->id());
     }
     else {
-      $query->condition('entity_type', NULL, 'IS');
-      $query->condition('entity_id', NULL, 'IS');
+      $query->notExists('entity_type');
+      $query->notExists('entity_id');
     }
     return ($query->execute()) ? TRUE : FALSE;
   }
