Merge branch 'bugfix/CXTDT-552909' into 'develop'
Digital PCT265 defect CXTDT-552909 - Client crash prevention on invalid module JSON. ### Summary Client resilience check for invalid module data. ### JIRA Ticket https://onejira.verizon.com/browse/CXTDT-552909 Co-authored-by: Hedden, Kyle Matthew <kyle.hedden@verizonwireless.com> See merge request https://gitlab.verizon.com/BPHV_MIPS/mvm_core/-/merge_requests/329
This commit is contained in:
commit
4bded0a433
@ -365,6 +365,16 @@ static NSString * const STATIC_CACHE_COMPONENT = @"StaticCache.txt";
|
|||||||
|
|
||||||
- (void)addModulesToCache:(nonnull NSDictionary *)jsonDictionary queue:(nullable NSOperationQueue *)queue waitUntilFinished:(BOOL)waitUntilFinished completionBlock:(nullable void (^)(void))completionBlock {
|
- (void)addModulesToCache:(nonnull NSDictionary *)jsonDictionary queue:(nullable NSOperationQueue *)queue waitUntilFinished:(BOOL)waitUntilFinished completionBlock:(nullable void (^)(void))completionBlock {
|
||||||
[jsonDictionary enumerateKeysAndObjectsUsingBlock:^(id _Nonnull key, id _Nonnull obj, BOOL * _Nonnull stop) {
|
[jsonDictionary enumerateKeysAndObjectsUsingBlock:^(id _Nonnull key, id _Nonnull obj, BOOL * _Nonnull stop) {
|
||||||
|
if (![obj isKindOfClass:[NSDictionary class]]) {
|
||||||
|
MVMCoreErrorObject *error = [[MVMCoreErrorObject alloc]
|
||||||
|
initWithTitle:nil
|
||||||
|
messageToLog:[NSString stringWithFormat:@"Invalid module format. Cannot cache %@ as it's not an object", key]
|
||||||
|
code:ErrorCodeJSONNotDictionary
|
||||||
|
domain:ErrorDomainSystem
|
||||||
|
location:NSStringFromClass([self class])];
|
||||||
|
[MVMCoreLoggingHandler.sharedLoggingHandler addErrorToLog:error];
|
||||||
|
return;
|
||||||
|
}
|
||||||
[self addModuleToCache:obj module:key];
|
[self addModuleToCache:obj module:key];
|
||||||
}];
|
}];
|
||||||
__weak typeof(self) weakSelf = self;
|
__weak typeof(self) weakSelf = self;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user