Index: flag.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/flag/Attic/flag.module,v
retrieving revision 1.11.2.72.2.35
diff -u -r1.11.2.72.2.35 flag.module
--- flag.module	8 May 2010 03:02:15 -0000	1.11.2.72.2.35
+++ flag.module	8 May 2010 03:22:25 -0000
@@ -727,7 +727,12 @@
   // Restrict access by authorship. It's important that TRUE is never returned
   // here, otherwise we'd grant permission even if other modules denied access.
   if ($flag->content_type == 'node') {
-    $node = node_load($content_id);
+    // For non-existent nodes (such as on the node add form), assume that the
+    // current user is creating the content.
+    if (empty($content_id) || !($node = node_load($content_id))) {
+      return $flag->access_author == 'others' ? FALSE : NULL;
+    }
+
     if ($flag->access_author == 'own' && $node->uid != $account->uid) {
       return FALSE;
     }
@@ -738,7 +743,12 @@
 
   // Restrict access by comment authorship.
   if ($flag->content_type == 'comment') {
-    $comment = $flag->fetch_content($content_id);
+    // For non-existent comments (such as on the comment add form), assume that
+    // the current user is creating the content.
+    if (empty($content_id) || !($comment = $flag->fetch_content($content_id))) {
+      return $flag->access_author == 'comment_others' ? FALSE : NULL;
+    }
+
     $node = node_load($comment->nid);
     if ($flag->access_author == 'node_own' && $node->uid != $account->uid) {
       return FALSE;
