File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -99,17 +99,26 @@ - (instancetype)initWithFileURL:(NSURL *)fileURL
9999 NSDictionary *icons = infoDictionary[@" CFBundleIcons" ];
100100 NSDictionary *primaryIcon = icons[@" CFBundlePrimaryIcon" ];
101101
102- NSArray *iconFiles = primaryIcon[@" CFBundleIconFiles" ];
103- if (iconFiles == nil )
104- {
105- iconFiles = infoDictionary[@" CFBundleIconFiles" ];
106- }
102+ NSString *iconName = nil ;
107103
108- NSString *iconName = [iconFiles lastObject ];
109- if (iconName == nil )
104+ if ([primaryIcon isKindOfClass: [NSString class ]])
110105 {
111- iconName = infoDictionary[ @" CFBundleIconFile " ] ;
106+ iconName = ( NSString *)primaryIcon ;
112107 }
108+ else
109+ {
110+ NSArray *iconFiles = primaryIcon[@" CFBundleIconFiles" ];
111+ if (iconFiles == nil )
112+ {
113+ iconFiles = infoDictionary[@" CFBundleIconFiles" ];
114+ }
115+
116+ iconName = [iconFiles lastObject ];
117+ if (iconName == nil )
118+ {
119+ iconName = infoDictionary[@" CFBundleIconFile" ];
120+ }
121+ }
113122
114123 _fileURL = [fileURL copy ];
115124 _name = [name copy ];
You can’t perform that action at this time.
0 commit comments