mirror of
https://github.com/arichornlover/uYouEnhanced.git
synced 2026-04-21 07:41:59 +00:00
Fix crash
This commit is contained in:
parent
572ebf3e3b
commit
f7b644457f
1 changed files with 5 additions and 5 deletions
|
|
@ -281,10 +281,10 @@ BOOL isAd(YTIElementRenderer *self) {
|
||||||
- (void)layoutSubviews {
|
- (void)layoutSubviews {
|
||||||
%orig;
|
%orig;
|
||||||
// Get the badge of this cell, as it is language-independent and unique
|
// Get the badge of this cell, as it is language-independent and unique
|
||||||
YTIconBadgeView *badgeView = self._iconBadgeView;
|
YTIconBadgeView *badgeView = [self valueForKey:@"_iconBadgeView"];
|
||||||
// First null check for badgeView
|
// First null check for badgeView
|
||||||
if (!badgeView) {
|
if (!badgeView) {
|
||||||
return; // Early return if badgeView is nil
|
return;
|
||||||
}
|
}
|
||||||
// Walk down the subviews to get to a specific view
|
// Walk down the subviews to get to a specific view
|
||||||
UIView *subview = badgeView.subviews.firstObject;
|
UIView *subview = badgeView.subviews.firstObject;
|
||||||
|
|
@ -293,12 +293,12 @@ BOOL isAd(YTIElementRenderer *self) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
UIImageView *imageView = subview.subviews.firstObject;
|
UIImageView *imageView = subview.subviews.firstObject;
|
||||||
// Third null check for the imageView
|
// Third null/inavlid check for the imageView
|
||||||
if (!imageView) {
|
if (!imageView || ![imageView respondsToSelector:@selector(description)]) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Get the description of this view
|
// Get the description of this view
|
||||||
NSString *description = imageView.description;
|
NSString *description = [imageView description];
|
||||||
// Check if "yt_outline_youtube_logo_icon" is in the description
|
// Check if "yt_outline_youtube_logo_icon" is in the description
|
||||||
if ([description containsString:@"yt_outline_youtube_logo_icon"]) {
|
if ([description containsString:@"yt_outline_youtube_logo_icon"]) {
|
||||||
self.hidden = YES; // Hide the cell
|
self.hidden = YES; // Hide the cell
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue