diff --git modules/node/node.module modules/node/node.module
index c052f4b..6d9dde6 100644
--- modules/node/node.module
+++ modules/node/node.module
@@ -613,16 +613,20 @@ function node_field_extra_fields() {
 /**
  * Deletes a node type from the database.
  *
- * @param $type
+ * @param $type_name
  *   The machine-readable name of the node type to be deleted.
  */
-function node_type_delete($type) {
-  $info = node_type_get_type($type);
+
+function node_type_delete($type_name) {
   db_delete('node_type')
-    ->condition('type', $type)
+    ->condition('type', $type_name)
     ->execute();
-  field_attach_delete_bundle('node', $type);
-  module_invoke_all('node_type_delete', $info);
+  field_attach_delete_bundle('node', $type_name);
+
+  $node_types = _node_types_build(TRUE)->types;
+  if (isset($node_types[$type_name])){
+    module_invoke_all('node_type_delete', $node_types[$type_name]);
+  }
 
   // Clear the node type cache.
   node_type_cache_reset();
diff --git modules/node/node.test modules/node/node.test
index 8a871c0..02f9655 100644
--- modules/node/node.test
+++ modules/node/node.test
@@ -1145,14 +1145,25 @@ class NodeTypeTestCase extends DrupalWebTestCase {
   /**
    * Test creating a content type programmatically and via a form.
    */
-  function testNodeTypeCreation() {
-    // Create a content type programmaticaly.
+  function testNodeTypeCreateDelete() {
+    // Create and delete a content type programmaticaly.
     $type = $this->drupalCreateContentType();
-
     $type_exists = db_query('SELECT 1 FROM {node_type} WHERE type = :type', array(':type' => $type->type))->fetchField();
     $this->assertTrue($type_exists, 'The new content type has been created in the database.');
+    node_type_delete($type->name);
+    $type_exists = db_query('SELECT 1 FROM {node_type} WHERE type = :type', array(':type' => $type->type))->fetchField();
+    $this->assertFalse($type_exists, 'The new content type has been deleted from the database.');
 
+    // Create, disable and delete a content type programmaticaly.
+    // Disabling a content type simulates disabling a module which creates the content type
+    $type = $this->drupalCreateContentType();
+    db_query("UPDATE {node_type} SET disabled = TRUE WHERE type = :type", array(':type' => $type->type));
+    node_type_delete($type->name);
+    $type_exists = db_query('SELECT 1 FROM {node_type} WHERE type = :type', array(':type' => $type->type))->fetchField();
+    $this->assertFalse($type_exists, 'A disabled content type has been deleted from the database.');
+    
     // Login a test user.
+    $type = $this->drupalCreateContentType();
     $web_user = $this->drupalCreateUser(array('create ' . $type->name . ' content'));
     $this->drupalLogin($web_user);
 
