From 28669972490c955e24b93e462a49fc899b570240 Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Thu, 26 Jul 2018 16:40:05 -0400 Subject: [PATCH] hot fix for session being nil, causing operation to hang forever. Will change to logging error once we fix the session restart foreground race condition. Crash catch for carousel when no feed cards are found. Will not look right, but can't afford the crash in case of race condition that is still live with session clearing. Fix push feed leak --- MVMCore/MVMCore/LoadHandling/MVMCoreLoadHandler.m | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/MVMCore/MVMCore/LoadHandling/MVMCoreLoadHandler.m b/MVMCore/MVMCore/LoadHandling/MVMCoreLoadHandler.m index c407018..f619c83 100644 --- a/MVMCore/MVMCore/LoadHandling/MVMCoreLoadHandler.m +++ b/MVMCore/MVMCore/LoadHandling/MVMCoreLoadHandler.m @@ -310,8 +310,15 @@ } return nil; } + NSURLSession *session = [MVMCoreSessionObject sharedGlobal].session; - + if (!session) { +#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. + 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 ([[MFFreebeeHandler sharedHandler] isFreeBeeEnabled] && [[MFFreebeeHandler sharedHandler] isValidCampaign]) { BOOL isAllowedPage = [[MFFreebeeHandler sharedHandler] isAllowedPage:requestParameters.pageType];