diff --git a/scripts/rt-outreachy-payment-next.plx b/scripts/rt-outreachy-payment-next.plx
index d132dde..92f5c2c 100755
--- a/scripts/rt-outreachy-payment-next.plx
+++ b/scripts/rt-outreachy-payment-next.plx
@@ -101,7 +101,11 @@ while (my $file = readdir $dh) {
   }
 
   # Find the ticket number for this intern.
-
+  my $entity = LedgerTagFromTicket($ticket, 'Entity');
+  if (not defined $entity) {
+    print STDERR "\"$file\": \"$ticket\": Skipping: cannot determine Entity from ticket." ;
+    next;
+  }
   my(@nameComponents) = split(/\s*-\s*/, $name);
   my(@searchTerms);
   foreach my $name (@nameComponents) {