deliver/lib/deliver/upload_screenshots.rb in fastlane-2.156.0 vs deliver/lib/deliver/upload_screenshots.rb in fastlane-2.156.1

- old
+ new

@@ -133,11 +133,11 @@ UI.error("Too many screenshots found for device '#{screenshot.device_type}' in '#{screenshot.language}', skipping this one (#{screenshot.path})") next end checksum = UploadScreenshots.calculate_checksum(screenshot.path) - duplicate = app_screenshot_set.app_screenshots.any? { |s| s.source_file_checksum == checksum } + duplicate = (app_screenshot_set.app_screenshots || []).any? { |s| s.source_file_checksum == checksum } # Enqueue uploading job if it's not duplicated otherwise screenshot will be skipped if duplicate UI.message("Previous uploaded. Skipping '#{screenshot.path}'...") else @@ -177,10 +177,11 @@ end # Verify all screenshots states on App Store Connect are okay def retry_upload_screenshots_if_needed(iterator, states, number_of_screenshots, tries, localizations, screenshots_per_language) is_failure = states.fetch("FAILED", 0) > 0 - is_missing_screenshot = states.reduce(0) { |sum, (k, v)| sum + v } != number_of_screenshots + is_missing_screenshot = states.reduce(0) { |sum, (k, v)| sum + v } != number_of_screenshots && !screenshots_per_language.empty? + if is_failure || is_missing_screenshot if tries.zero? incomplete_screenshot_count = states.reject { |k, v| k == 'COMPLETE' }.reduce(0) { |sum, (k, v)| sum + v } UI.user_error!("Failed verification of all screenshots uploaded... #{incomplete_screenshot_count} incomplete screenshot(s) still exist") else