fix(artifacts): Handle CFBundlePrimaryIcon as string in get_icon_info (LAUNCHPAD-73)#604
Open
sentry[bot] wants to merge 1 commit intomainfrom
Open
fix(artifacts): Handle CFBundlePrimaryIcon as string in get_icon_info (LAUNCHPAD-73)#604sentry[bot] wants to merge 1 commit intomainfrom
sentry[bot] wants to merge 1 commit intomainfrom
Conversation
Contributor
Author
📲 Install BuildsAndroid
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes an
AttributeError: 'str' object has no attribute 'get'occurring inlaunchpad.process_message, specifically within theget_icon_infomethod ofsrc/launchpad/artifacts/apple/zipped_xcarchive.py.The root cause was that the
Info.plistfor some Apple artifacts (e.g.,com.bouyguestelecom.btv) can defineCFBundleIcons.CFBundlePrimaryIconas a plain string (e.g., "App Icon") rather than a dictionary. The original code correctly guarded theCFBundleIconNamelookup with anisinstance(primary_icon, dict)check, but the subsequent lookup forCFBundleIconFileswas performed unconditionally outside this guard.This led to an
AttributeErrorwhen.get()was called on a string object.The fix involves moving the
icon_files = primary_icon.get("CFBundleIconFiles", [])line and its subsequentisinstancecheck inside theif isinstance(primary_icon, dict):block. This ensures that the.get()method is only called whenprimary_iconis indeed a dictionary, preventing the crash. Whenprimary_iconis a string,primary_icon_fileswill correctly remain an empty list, providing a graceful fallback.Fixes LAUNCHPAD-73