From ae90e90d74fd9ad046285ff0bdb1dd796f785030 Mon Sep 17 00:00:00 2001 From: Michael Sarahan Date: Mon, 13 May 2019 21:32:30 -0500 Subject: [PATCH] handle empty size or md5 PackageCacheRecords better --- conda/core/package_cache_data.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/conda/core/package_cache_data.py b/conda/core/package_cache_data.py index d9127d2a15..16152abdf6 100644 --- a/conda/core/package_cache_data.py +++ b/conda/core/package_cache_data.py @@ -483,9 +483,9 @@ def pcrec_matches(pcrec): # It's just a quick match. # if sha256 is not None and pcrec.sha256 is not None: # matches = sha256 == pcrec.sha256 - if size is not None and pcrec.size is not None: + if size is not None and pcrec.get('size') is not None: matches = pcrec.size in (size, legacy_bz2_size) - if matches and md5 is not None and pcrec is not None: + if matches and md5 is not None and pcrec.get('md5') is not None: matches = pcrec.md5 in (md5, legacy_bz2_md5) return matches