Index: webformblock.module
===================================================================
--- webformblock.module	(revision 5908)
+++ webformblock.module	(working copy)
@@ -12,10 +12,7 @@
  *
  */
 function webformblock_form_alter(&$form, $form_state, $form_id) {
-  $node = $form['#parameters'][2];
-  
   if ($form_id == 'webform_node_form') {
-  
     $form['webform']['advanced']['addblock'] = array(
       '#type' => 'checkbox',
       '#return_value' => 1,
@@ -24,14 +21,19 @@
       '#description' => t('Allow this form to appear in its own block which can be positioned in any block region.'),
       '#weight' => -20,
     );
-  } elseif ($node->webform['addblock'] == 1) { 
-    form_clean_id(null, true);
-    $anchorname = form_clean_id(str_replace('/', '', strtolower( drupal_get_path_alias('node/' . $node->nid) ))); 
-    $form['#action'] = url(drupal_get_path_alias($_GET['q']), array('fragment' => $anchorname)); 
   }
+  else {
+    if (isset($form['#parameters'][2])) {
+      $node = $form['#parameters'][2];
+      if ($node->webform['addblock'] == 1) { 
+        form_clean_id(null, true);
+        $anchorname = form_clean_id(str_replace('/', '', strtolower( drupal_get_path_alias('node/' . $node->nid) ))); 
+        $form['#action'] = url(drupal_get_path_alias($_GET['q']), array('fragment' => $anchorname));
+      }
+    }
+  }
 }
 
-
 /*
  * See if a webform node should have a block visible for it
  * @returns true if the webform node id is listed in the webform_block table
