From 019839dbf92a5d36c162a80abf6944d8f4a5f3a3 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Mon, 17 Jan 2022 22:06:49 +0100 Subject: [PATCH] certificates: fix edge case where None is returned, triggering 'NoneType has no attribute get' --- src/yunohost/certificate.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/yunohost/certificate.py b/src/yunohost/certificate.py index 2f3676202..3d90895c7 100644 --- a/src/yunohost/certificate.py +++ b/src/yunohost/certificate.py @@ -860,14 +860,14 @@ def _check_domain_is_ready_for_ACME(domain): if is_yunohost_dyndns_domain(parent_domain): record_name = "@" - A_record_status = dnsrecords.get("data").get(f"A:{record_name}") - AAAA_record_status = dnsrecords.get("data").get(f"AAAA:{record_name}") + A_record_status = dnsrecords.get("data", {}).get(f"A:{record_name}") + AAAA_record_status = dnsrecords.get("data", {}).get(f"AAAA:{record_name}") # Fallback to wildcard in case no result yet for the DNS name? if not A_record_status: - A_record_status = dnsrecords.get("data").get("A:*") + A_record_status = dnsrecords.get("data", {}).get("A:*") if not AAAA_record_status: - AAAA_record_status = dnsrecords.get("data").get("AAAA:*") + AAAA_record_status = dnsrecords.get("data", {}).get("AAAA:*") if ( not httpreachable