diff --git a/find/parser.c b/find/parser.c
index 75bbe69..594f1fb 100644
--- a/find/parser.c
+++ b/find/parser.c
@@ -911,7 +911,10 @@ static boolean
 parse_gid (const struct parser_table* entry, char **argv, int *arg_ptr)
 {
   struct predicate *p = insert_num (argv, arg_ptr, entry);
-  p->est_success_rate = (p->args.numinfo.l_val < 100) ? 0.99 : 0.2;
+  if(p)
+    {
+      p->est_success_rate = (p->args.numinfo.l_val < 100) ? 0.99 : 0.2;
+    }
   return p;
 }
 
diff --git a/find/tree.c b/find/tree.c
index e0c44c8..916ee92 100644
--- a/find/tree.c
+++ b/find/tree.c
@@ -1245,29 +1245,29 @@ build_expression_tree(int argc, char *argv[], int end_of_leading_options)
          i++;
        }
       oldi = i;
-      if (!(*(parse_entry->parser_func)) (parse_entry, argv, &i))
+      if (!argv[i] || !(*(parse_entry->parser_func)) (parse_entry, argv, &i))
        {
-         if (argv[i])
-           {
-             if ( (ARG_SPECIAL_PARSE == parse_entry->type) && (i == oldi) )
-               {
-                 /* The special parse function spat out the
-                  * predicate.  It must be invalid, or not tasty.
-                  */
-                 error (1, 0, _("invalid predicate `%s'"),
-                        predicate_name);
-               }
+          if ( (ARG_SPECIAL_PARSE == parse_entry->type) && (i == oldi) )
+            {
+              /* The special parse function spat out the
+               * predicate.  It must be invalid, or not tasty.
+               */
+              error (1, 0, _("invalid predicate `%s'"),
+                     predicate_name);
+            }
+          else
+            {
+             if (argv[oldi])
+               {
+                 error (1, 0, _("invalid argument `%s' to `%s'"),
+                      argv[oldi], predicate_name);
+                }
              else
-               {
-                 error (1, 0, _("invalid argument `%s' to `%s'"),
-                        argv[i], predicate_name);
-               }
-           }
-         else
-           {
-             /* Command line option requires an argument */
-             error (1, 0, _("missing argument to `%s'"), predicate_name);
-           }
+               {
+                 /* Command line option requires an argument */
+                 error (1, 0, _("missing argument to `%s'"), predicate_name);
+               }
+            }
        }
       else
        {
