get_errors? fixed

master
Philippe Pittoli 2023-05-07 05:06:15 +02:00
parent ad83a34437
commit a7c2096423
1 changed files with 6 additions and 2 deletions

View File

@ -259,7 +259,7 @@ class DNSManager::Storage::Zone
io << "TEST"
end
def get_errors? : Array(Error)
def get_errors? : Array(Error)?
errors = [] of Error
unless Zone.is_domain_valid? @domain
errors << "invalid domain #{@domain}"
@ -280,7 +280,11 @@ class DNSManager::Storage::Zone
errors << "invalid zone: no NS record"
end
errors
if errors.empty?
nil
else
errors
end
end
# This regex only is "good enough for now".