--- a/sites/default/modules/contrib/og_subgroups/og_subgroups.module	2012-05-11 17:46:05.000000000 -0500
+++ b/sites/default/modules/contrib/og_subgroups/og_subgroups.module.patched	2012-05-11 17:47:37.000000000 -0500
@@ -88,6 +88,11 @@
  *   Boolean indication if operation preformed was successful
  */
 function og_subgroups_set_parent($node, $parent = NULL) {
+  // If there is no parent node, return FALSE.
+  if (empty($parent)) {
+    return FALSE;
+  }
+
   // Either objects or node ids can be passed in
   $nid = is_object($node) ? $node->nid : $node;
   $pid = is_object($parent) ? $parent->nid : $parent;
@@ -107,7 +112,7 @@
   $success = db_query("DELETE FROM {og_subgroups} WHERE gid = %d", $nid);
 
   // Only save a new setting if a parent was specified
-  if ($success && $pid) {
+  if ($success) {
     // Save the new parent
     $record = new stdClass;
     $record->gid = $nid;
