From aa924816b6c468790dc236d5a5f7f74c01e99d9d Mon Sep 17 00:00:00 2001 From: Michael Elkins Date: Tue, 19 Mar 2013 17:15:48 +0000 Subject: need to guard against issuer being None the first time we process the root cert since the object is not yet in the db closes #475 svn path=/trunk/; revision=5174 --- rpkid/rpki/gui/cacheview/util.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'rpkid/rpki/gui/cacheview/util.py') diff --git a/rpkid/rpki/gui/cacheview/util.py b/rpkid/rpki/gui/cacheview/util.py index dffa591f..8ba7d89f 100644 --- a/rpkid/rpki/gui/cacheview/util.py +++ b/rpkid/rpki/gui/cacheview/util.py @@ -67,15 +67,17 @@ def rcynic_cert(cert, obj): else: obj.asns.add(q[0]) + # obj.issuer is None the first time we process the root cert in the + # hierarchy, so we need to guard against dereference for cls, addr_obj, addrset, parentset in ( models.AddressRange, obj.addresses, cert.resources.v4, - obj.issuer.addresses + obj.issuer.addresses.all() if obj.issuer else [] ), ( models.AddressRangeV6, obj.addresses_v6, cert.resources.v6, - obj.issuer.addresses_v6 + obj.issuer.addresses_v6.all() if obj.issuer else [] ): if addrset.inherit: - addr_obj.add(*parentset.all()) + addr_obj.add(*parentset) else: for rng in addrset: logger.debug('processing %s' % rng) -- cgit v1.2.3