anchor.diff:          _logger.info(
               "Analysis lookup failed for $package $version (panaVersion=$panaVersion)");
         }
  +    }
  +
  +    if (analysis == null) {
  +      return null;
       }
   
       // analysis was set
  
positive.code:             'PackageVersionAnalysis lookup failed: no entry for $package $version.');
          return null;
        }
        analysis = pva.latestAnalysis;
        lookupMatchingPanaVersion =
            panaVersion != null && pva.panaVersion != panaVersion;
      }
  
      if (lookupMatchingPanaVersion) {
        final Query query = db.query(Analysis, ancestorKey: versionKey)
          ..filter('panaVersion =', panaVersion);
        final List<Analysis> list = await query.run().toList();
  
negative.code:     final Key versionKey =
          packageKey.append(PackageVersionAnalysis, id: version);
  
      if (analysis == null) {
        final list = await db.lookup([versionKey]);
        final PackageVersionAnalysis pva = list[0];
  