Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

图片URL为空字符串时请求异常 #434

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion YYKit/Image/Categories/CALayer+YYWebImage.m
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ - (void)setImageWithURL:(NSURL *)imageURL
[self removeAnimationForKey:_YYWebImageFadeAnimationKey];
}

if (!imageURL) {
if (!imageURL || imageURL.absoluteString.length == 0) {
if (!(options & YYWebImageOptionIgnorePlaceHolder)) {
self.contents = (id)placeholder.CGImage;
}
Expand Down
2 changes: 1 addition & 1 deletion YYKit/Image/Categories/MKAnnotationView+YYWebImage.m
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ - (void)setImageWithURL:(NSURL *)imageURL
[self.layer removeAnimationForKey:_YYWebImageFadeAnimationKey];
}
}
if (!imageURL) {
if (!imageURL || imageURL.absoluteString.length == 0) {
if (!(options & YYWebImageOptionIgnorePlaceHolder)) {
self.image = placeholder;
}
Expand Down
4 changes: 2 additions & 2 deletions YYKit/Image/Categories/UIButton+YYWebImage.m
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ - (void)_setImageWithURL:(NSURL *)imageURL
int32_t sentinel = [setter cancelWithNewURL:imageURL];

dispatch_async_on_main_queue(^{
if (!imageURL) {
if (!imageURL || imageURL.absoluteString.length == 0) {
if (!(options & YYWebImageOptionIgnorePlaceHolder)) {
[self setImage:placeholder forState:state.integerValue];
}
Expand Down Expand Up @@ -273,7 +273,7 @@ - (void)_setBackgroundImageWithURL:(NSURL *)imageURL
int32_t sentinel = [setter cancelWithNewURL:imageURL];

dispatch_async_on_main_queue(^{
if (!imageURL) {
if (!imageURL || imageURL.absoluteString.length == 0) {
if (!(options & YYWebImageOptionIgnorePlaceHolder)) {
[self setBackgroundImage:placeholder forState:state.integerValue];
}
Expand Down
4 changes: 2 additions & 2 deletions YYKit/Image/Categories/UIImageView+YYWebImage.m
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ - (void)setImageWithURL:(NSURL *)imageURL
}
}

if (!imageURL) {
if (!imageURL || imageURL.absoluteString.length == 0) {
if (!(options & YYWebImageOptionIgnorePlaceHolder)) {
self.image = placeholder;
}
Expand Down Expand Up @@ -281,7 +281,7 @@ - (void)setHighlightedImageWithURL:(NSURL *)imageURL
[self.layer removeAnimationForKey:_YYWebImageFadeAnimationKey];
}
}
if (!imageURL) {
if (!imageURL || imageURL.absoluteString.length == 0) {
if (!(options & YYWebImageOptionIgnorePlaceHolder)) {
self.highlightedImage = placeholder;
}
Expand Down