File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -1136,10 +1136,13 @@ - (void)setAlternateIconWithFilename:(NSString *)filename
11361136 }
11371137
11381138 [app setAlternateIconName: iconName completionHandler: ^(NSError * _Nullable error) {
1139- NSLog (@" Fail to change app icon: %@ . Trying again." , error);
1140-
1139+ if (!error) {
1140+ return ;
1141+ }
1142+
11411143 // Common failure is when setAlternateIconName: is called right upon start.
11421144 // Try again after 1 second.
1145+ NSLog (@" Fail to change app icon: %@ . Trying again." , error);
11431146 dispatch_time_t dispatchTime = dispatch_time (DISPATCH_TIME_NOW, 1 * NSEC_PER_SEC);
11441147 dispatch_after (dispatchTime, dispatch_get_main_queue (), ^{
11451148 [[UIApplication sharedApplication ] setAlternateIconName: iconName
You can’t perform that action at this time.
0 commit comments