diff --git a/LeanMapper/Repository.php b/LeanMapper/Repository.php
index <HASH>..<HASH> 100644
--- a/LeanMapper/Repository.php
+++ b/LeanMapper/Repository.php
@@ -81,11 +81,12 @@ abstract class Repository
 						->where('%n = ?', $primaryKey, $entity->$idField)
 						->execute();
 				$entity->markAsUpdated();
-
-				return $result;
 			}
 		}
 		$this->persistHasManyChanges($entity);
+		if (isset($result)) {
+			return $result;
+		}
 	}
 
 	/**
Fixed place where Repository::persistHasManyChanges is called