@@ -427,21 +427,27 @@ def self.upgrade_cask(
427427
428428 new_cask_installer . fetch
429429
430- old_cask . artifacts . grep ( Artifact ::App ) . each do |artifact |
431- user_approved = if artifact . target . exist?
432- Quarantine . user_approved? ( artifact . target )
433- else
434- false
435- end
436- old_user_approved [ artifact . target . to_s ] = user_approved
437- # Only an already approved app has approvals to pass on, so skip the scan otherwise.
438- old_approved_paths [ artifact . target . to_s ] = Quarantine . user_approved_paths ( artifact . target ) if user_approved
439- old_unquarantined [ artifact . target . to_s ] = if artifact . target . exist?
440- Quarantine . detect ( artifact . target ) . blank?
441- else
442- false
430+ # This snapshot reads quarantine metadata, so it needs the same guard as the code below that uses it.
431+ if Quarantine . available?
432+ old_cask . artifacts . grep ( Artifact ::App ) . each do |artifact |
433+ user_approved = if artifact . target . exist?
434+ Quarantine . user_approved? ( artifact . target )
435+ else
436+ false
437+ end
438+ old_user_approved [ artifact . target . to_s ] = user_approved
439+ # Only an already approved app has approvals to pass on, so skip the scan otherwise.
440+ if user_approved
441+ old_approved_paths [ artifact . target . to_s ] =
442+ Quarantine . user_approved_paths ( artifact . target )
443+ end
444+ old_unquarantined [ artifact . target . to_s ] = if artifact . target . exist?
445+ Quarantine . detect ( artifact . target ) . blank?
446+ else
447+ false
448+ end
449+ old_signing_identities [ artifact . target . to_s ] = Quarantine . signing_identity ( artifact . target )
443450 end
444- old_signing_identities [ artifact . target . to_s ] = Quarantine . signing_identity ( artifact . target )
445451 end
446452
447453 # Move the old cask's artifacts back to staging
0 commit comments