diff --git a/src/StockServiceManager.php b/src/StockServiceManager.php
index d4c7279..a5e2224 100755
--- a/src/StockServiceManager.php
+++ b/src/StockServiceManager.php
@@ -110,10 +110,12 @@ class StockServiceManager implements StockServiceManagerInterface, StockTransact
     // Make sure the current store is in the entity stores.
     $stores = $entity->getStores();
     $found = FALSE;
-    foreach ($stores as $store) {
-      if ($store->id() == $store_to_use->id()) {
-        $found = TRUE;
-        break;
+    if ($store_to_use) {
+      foreach ($stores as $store) {
+        if ($store->id() == $store_to_use->id()) {
+          $found = TRUE;
+          break;
+        }
       }
     }
     // If not.
