Permalink
Browse files

Check if we got an image back. Refs #6

  • Loading branch information...
1 parent 89b1b77 commit 45689ac4626f338aceff181c4b5b9b75b55cb1c0 @matej committed Mar 29, 2013
@@ -106,7 +106,7 @@
isa = PBXGroup;
children = (
D2898CD016D76B1200FD4FF1 /* App */,
- D2898CE016D771B300FD4FF1 /* Images (Fron) */,
+ D2898CE016D771B300FD4FF1 /* Images (Front) */,
D2898CDF16D7719600FD4FF1 /* Settings (Back) */,
D2898CE116D771BB00FD4FF1 /* Info */,
D2898CDB16D76BEA00FD4FF1 /* MBPullDownController */,
@@ -158,7 +158,7 @@
name = "Settings (Back)";
sourceTree = "<group>";
};
- D2898CE016D771B300FD4FF1 /* Images (Fron) */ = {
+ D2898CE016D771B300FD4FF1 /* Images (Front) */ = {
isa = PBXGroup;
children = (
D246C43B16DA7B31002D94D6 /* MBImagesViewController.h */,
@@ -167,7 +167,7 @@
D246C44116DA7BCF002D94D6 /* MBImageCell.m */,
D246C43D16DA7B31002D94D6 /* MBImagesViewController.xib */,
);
- name = "Images (Fron)";
+ name = "Images (Front)";
sourceTree = "<group>";
};
D2898CE116D771BB00FD4FF1 /* Info */ = {
@@ -113,7 +113,9 @@ - (void)connection:(NSURLConnection*)connection didFailWithError:(NSError*)error
- (void)connectionDidFinishLoading:(NSURLConnection *)connection {
UIImage *image = [UIImage imageWithData:self.responseData];
[self setImage:image animated:YES];
- [[MBImagesViewController cache] setObject:image forKey:connection.originalRequest.URL];
+ if (image) {
+ [[MBImagesViewController cache] setObject:image forKey:connection.originalRequest.URL];
+ }
[self.activityIndicator stopAnimating];
self.responseData = nil;
}

0 comments on commit 45689ac

Please sign in to comment.