lib/spaceship/tunes/app_version.rb in spaceship-0.31.1 vs lib/spaceship/tunes/app_version.rb in spaceship-0.31.2
- old
+ new
@@ -352,11 +352,11 @@
# @param icon_path (String): The path to the screenshot. Use nil to remove it
# @param sort_order (Fixnum): The sort_order, from 1 to 5
# @param language (String): The language for this screenshot
# @param device (string): The device for this screenshot
def upload_screenshot!(screenshot_path, sort_order, language, device)
- raise "sort_order must be positive" unless sort_order > 0
+ raise "sort_order must be higher than 0" unless sort_order > 0
raise "sort_order must not be > 5" if sort_order > 5
# this will also check both language and device parameters
device_lang_screenshots = screenshots_data_for_language_and_device(language, device)["value"]
existing_sort_orders = device_lang_screenshots.map { |s| s["value"]["sortOrder"] }
@@ -555,10 +555,12 @@
end
end
# generates the nested data structure to represent screenshots
def setup_screenshots_for(row)
+ return [] if row.nil? || row["displayFamilies"].nil?
+
display_families = row.fetch("displayFamilies", {}).fetch("value", nil)
return [] unless display_families
result = []
@@ -626,9 +628,11 @@
end
end
# generates the nested data structure to represent trailers
def setup_trailers_for(row)
+ return [] if row.nil? || row["displayFamilies"].nil?
+
display_families = row.fetch("displayFamilies", {}).fetch("value", nil)
return [] unless display_families
result = []