diff --git a/relation.module b/relation.module
index 5c7462c..021a9e3 100644
--- a/relation.module
+++ b/relation.module
@@ -440,8 +440,8 @@ function relation_type_load($relation_type) {
  * Loads a relation type (bundle), or all relation bundles.
  *
  * @param $types
- *   An array of machine names of the relation types to be loaded. If $types
- *   is empty, load all relation types.
+ *   (optional) An array of machine names of the relation types to be loaded. 
+ *   If $types is empty, load all relation types.
  *
  * @return
  *   A an array of relation type records in the same format as expected by
@@ -744,6 +744,13 @@ function relation_save($relation) {
   catch (FieldValidationException $e) {
     return FALSE;
   }
+  // Ensure that relation type exists
+  if (!array_key_exists($relation->relation_type, relation_get_types())) {
+    drupal_set_message(t('Relation type !type does not exist.', array(
+      '!type' => '<em>' . check_plain($relation->relation_type) . '</em>'
+    )), 'error');
+    return FALSE;
+  }
   // Determine if we will be inserting a new relation.
   if (!isset($relation->is_new)) {
     $relation->is_new = empty($relation->rid);
diff --git a/tests/relation.test b/tests/relation.test
index c3fdc33..2f51d8a 100644
--- a/tests/relation.test
+++ b/tests/relation.test
@@ -361,6 +361,10 @@ class RelationAPITestCase extends RelationTestCase {
           ->execute()
           ->fetchAllAssoc('rid');
       $this->assertTrue(array_key_exists($rid, $revision), 'Relation revision created.');
+      // Test invalid relation type
+      $relation->relation_type = 'invalid_relation_type';
+      $rid = relation_save($relation);
+      $this->assertFalse($rid, 'Wrong relation type relation not created.');
     }
   }
 
