From 4542e8206058204253394136063738763433f0f6 Mon Sep 17 00:00:00 2001 From: Scott Pfeil Date: Tue, 29 Aug 2023 17:27:44 -0400 Subject: [PATCH] code review fixes --- MVMCore/MVMCore/LoadHandling/MVMCoreLoadHandler.m | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/MVMCore/MVMCore/LoadHandling/MVMCoreLoadHandler.m b/MVMCore/MVMCore/LoadHandling/MVMCoreLoadHandler.m index 792395b..0f12d4a 100644 --- a/MVMCore/MVMCore/LoadHandling/MVMCoreLoadHandler.m +++ b/MVMCore/MVMCore/LoadHandling/MVMCoreLoadHandler.m @@ -191,9 +191,7 @@ } } -- (void)getInitialParametersExcludingSections:(NSSet *_Nullable)excludeSections closure:(nonnull void (^)(NSDictionary *_Nullable parameters))closure { - -} +- (void)getInitialParametersExcludingSections:(NSSet *_Nullable)excludeSections closure:(nonnull void (^)(NSDictionary *_Nullable parameters))closure {} - (void)getJsonDictionary:(nonnull MVMCoreRequestParameters *)requestParameters closure:(nonnull void (^)(NSDictionary * _Nullable jsonDictionary))closure { NSMutableDictionary *parameters = [NSMutableDictionary dictionary]; @@ -277,7 +275,9 @@ - (void)sendRequest:(nonnull MVMCoreRequestParameters *)requestParameters locationForError:(nonnull NSString *)locationForError requestFinished:(nullable void (^)(id _Nullable jsonObject, MVMCoreErrorObject *_Nullable error))requestFinished { [self transformToRequestWithParameters:requestParameters closure:^(NSURLRequest * _Nullable request, MVMCoreErrorObject * _Nullable error) { if (error) { - requestFinished(nil, error); + if (requestFinished) { + requestFinished(nil, error); + } return; } [self sendRequest:request requestParameters:requestParameters locationForError:locationForError requestFinished:requestFinished]; @@ -301,7 +301,9 @@ #warning Hotfix for when session is nil. We should switch to logging these errors once we fix how session handler misses canceling certain calls because they happen at the same time. MVMCoreErrorObject *error = [[MVMCoreErrorObject alloc] initWithTitle:[MVMCoreGetterUtility hardcodedStringWithKey:HardcodedErrorTitle] message:[MVMCoreGetterUtility hardcodedStringWithKey:HardcodedErrorCritical] messageToLog:nil code:ErrorCodeDefault domain:ErrorDomainNative location:locationForError]; error.logError = NO; - requestFinished(nil,error); + if (requestFinished) { + requestFinished(nil, error); + } return nil; }