File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -708,7 +708,7 @@ def check_domain(domain)
708708 return unless domain.count('.' ) == 1
709709 puts
710710 print(" domain #{ domain } expires on " )
711- time = ` whois #{ domain } `
711+ times = ` whois #{ domain } `
712712 .split(" \n " )
713713 .select { |i | i.includes?(" Expiry Date:" ) || i.includes?(" Expiration Date:" ) || i.includes?(" paid-till:" ) }
714714 .map { |i |
@@ -721,8 +721,8 @@ def check_domain(domain)
721721 }
722722 .select { |i | ! i.nil? && ! i.empty? && i[-1 ] == 'Z' }
723723 .map { |i | Time .parse_rfc3339(i.not_nil!) }
724- .min
725- print_expiration(time )
724+
725+ print_expiration(times.empty? ? nil : times.min )
726726 print(" " )
727727 print_dnssec_status(domain)
728728end
@@ -1855,6 +1855,10 @@ def nonempty_exists?(path : Path)
18551855end
18561856
18571857def print_expiration (time )
1858+ if time.nil?
1859+ warn(" unknown expiration" )
1860+ return
1861+ end
18581862 now = Time .utc
18591863 if now < time
18601864 if now + 30 .days >= time
You can’t perform that action at this time.
0 commit comments