git: d7a4ae268a - main - ports.cgi: less perl warnings

Wolfram Schneider <[email protected]>
Newsgroups gmane.os.freebsd.devel.cvs.doc
Message-ID <[email protected]>
The branch main has been updated by wosch:

URL: https://cgit.FreeBSD.org/doc/commit/?id=d7a4ae268a5836b8a3f2640e3934611d1cc3fdae

commit d7a4ae268a5836b8a3f2640e3934611d1cc3fdae
Author:     Wolfram Schneider <[email protected]>
AuthorDate: 2026-01-21 08:20:26 +0000
Commit:     Wolfram Schneider <[email protected]>
CommitDate: 2026-01-21 08:20:26 +0000

    ports.cgi: less perl warnings
---
 website/content/en/cgi/ports.cgi | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/website/content/en/cgi/ports.cgi b/website/content/en/cgi/ports.cgi
index dfac37d9f3..d5214284f6 100755
--- a/website/content/en/cgi/ports.cgi
+++ b/website/content/en/cgi/ports.cgi
@@ -363,8 +363,11 @@ sub search_ports {
         elsif ( $stype eq 'maintainer' && $a[5] =~ /$query/io ) {
             &out( $today{$key} );
         }
-        elsif ( $stype eq 'requires'
-            && ( $a[7] =~ /$query/io || $a[8] =~ /$query/io ) )
+        elsif (
+            $stype eq 'requires'
+            && ( defined $a[7] && $a[7] =~ /$query/io
+                || ( defined $a[8] && $a[8] =~ /$query/io ) )
+          )
         {
             &out( $today{$key} );
         }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.