Skip to content
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
9 changes: 9 additions & 0 deletions WordPress/Classes/Services/BlogService.m
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,15 @@ - (void)syncBlog:(Blog *)blog
success:(void (^)(void))success
failure:(void (^)(NSError *error))failure
{
if (!blog) {
// Reuse an existing error type. This branch is an edge case and no caller inspects the error.
NSError *error = [NSError errorWithDomain:WordPressComRestApiErrorDomain
code:WordPressComRestApiErrorCodeInvalidInput
userInfo:@{NSDebugDescriptionErrorKey: @"Cannot sync a nil blog"}];
failure(error);
return;
}

if ([blog supports:BlogFeatureWpComRESTAPI]) {
id<BlogServiceRemote> remote = [self remoteForBlog:blog];
if ([remote isKindOfClass:[BlogServiceRemoteREST class]]) {
Expand Down
2 changes: 1 addition & 1 deletion WordPress/Classes/ViewRelated/Stats/StatsViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

@interface StatsViewController : UIViewController

@property (nonatomic, weak, nullable) Blog *blog;
@property (nonatomic, strong, nullable) Blog *blog;
@property (nonatomic, copy, nullable) void (^dismissBlock)(void);

@end