diff --git a/modules/product/src/Form/ProductVariationInlineForm.php b/modules/product/src/Form/ProductVariationInlineForm.php
index 360c765..1036014 100644
--- a/modules/product/src/Form/ProductVariationInlineForm.php
+++ b/modules/product/src/Form/ProductVariationInlineForm.php
@@ -69,9 +69,14 @@ class ProductVariationInlineForm extends EntityInlineForm {
     // relevant in this context, the user only needs to see the attribute part.
     if ($attribute_values = $entity->getAttributeValues()) {
       $attribute_labels = array_map(function ($attribute_value) {
-        return $attribute_value->label();
+        if ($attribute_value) {
+          return $attribute_value->label();
+        }
+        else {
+          drupal_set_message('An invalid attribute value is detected. It might be because you deleted some attribute or its value. It is highly recommended to remove variations having invalid attribute values.', 'error');
+          return t('INVALID!!!');
+        }
       }, $attribute_values);
-
       $label = implode(', ', $attribute_labels);
     }
     else {
diff --git a/src/Entity/CommerceContentEntityBase.php b/src/Entity/CommerceContentEntityBase.php
index 026a79c..95e0870 100644
--- a/src/Entity/CommerceContentEntityBase.php
+++ b/src/Entity/CommerceContentEntityBase.php
@@ -44,7 +44,9 @@ class CommerceContentEntityBase extends ContentEntityBase implements CommerceCon
     }
     foreach ($entities as $index => $entity) {
       /** @var \Drupal\Core\Entity\ContentEntityInterface $entity */
-      $entities[$index] = ($entity->hasTranslation($langcode)) ? $entity->getTranslation($langcode) : $entity;
+      if ($entity) {
+        $entities[$index] = ($entity->hasTranslation($langcode)) ? $entity->getTranslation($langcode) : $entity;
+      }
     }
 
     return $entities;
