forked from CIT/Vmeda.Online
		
	MOBILE-3932 resource: Fix some non-null assertions warnings
This commit is contained in:
		
							parent
							
								
									29e2119143
								
							
						
					
					
						commit
						080e370136
					
				@ -204,7 +204,7 @@ export class AddonModBookIndexComponent extends CoreCourseModuleMainResourceComp
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        // Chapter loaded, log view.
 | 
					        // Chapter loaded, log view.
 | 
				
			||||||
        await CoreUtils.ignoreErrors(AddonModBook.logView(
 | 
					        await CoreUtils.ignoreErrors(AddonModBook.logView(
 | 
				
			||||||
            this.module.instance!,
 | 
					            this.module.instance,
 | 
				
			||||||
            logChapterId ? chapterId : undefined,
 | 
					            logChapterId ? chapterId : undefined,
 | 
				
			||||||
            this.module.name,
 | 
					            this.module.name,
 | 
				
			||||||
        ));
 | 
					        ));
 | 
				
			||||||
 | 
				
			|||||||
@ -1252,7 +1252,7 @@ export class CoreCourseModulePrefetchDelegateService extends CoreDelegate<CoreCo
 | 
				
			|||||||
        // Treat warnings, adding the not supported modules.
 | 
					        // Treat warnings, adding the not supported modules.
 | 
				
			||||||
        response.warnings?.forEach((warning) => {
 | 
					        response.warnings?.forEach((warning) => {
 | 
				
			||||||
            if (warning.warningcode == 'missingcallback') {
 | 
					            if (warning.warningcode == 'missingcallback') {
 | 
				
			||||||
                result[warning.itemid!] = false;
 | 
					                result[warning.itemid || -1] = false;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        });
 | 
					        });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -1304,10 +1304,10 @@ export class CoreCourseModulePrefetchDelegateService extends CoreDelegate<CoreCo
 | 
				
			|||||||
        this.statusCache.invalidate(packageId);
 | 
					        this.statusCache.invalidate(packageId);
 | 
				
			||||||
        this.statusCache.setValue(packageId, 'status', status);
 | 
					        this.statusCache.setValue(packageId, 'status', status);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (sectionId) {
 | 
					        if (courseId && sectionId) {
 | 
				
			||||||
            const data: CoreEventSectionStatusChangedData = {
 | 
					            const data: CoreEventSectionStatusChangedData = {
 | 
				
			||||||
                sectionId,
 | 
					                sectionId,
 | 
				
			||||||
                courseId: courseId!,
 | 
					                courseId: courseId,
 | 
				
			||||||
            };
 | 
					            };
 | 
				
			||||||
            CoreEvents.trigger(CoreEvents.SECTION_STATUS_CHANGED, data, CoreSites.getCurrentSiteId());
 | 
					            CoreEvents.trigger(CoreEvents.SECTION_STATUS_CHANGED, data, CoreSites.getCurrentSiteId());
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
				
			|||||||
@ -307,7 +307,7 @@ export class CoreMimetypeUtilsProvider {
 | 
				
			|||||||
        let position;
 | 
					        let position;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (split.length > 1) {
 | 
					        if (split.length > 1) {
 | 
				
			||||||
            candidate = split.pop()!.toLowerCase();
 | 
					            candidate = split[split.length - 1].toLowerCase();
 | 
				
			||||||
            // Remove params if any.
 | 
					            // Remove params if any.
 | 
				
			||||||
            position = candidate.indexOf('?');
 | 
					            position = candidate.indexOf('?');
 | 
				
			||||||
            if (position > -1) {
 | 
					            if (position > -1) {
 | 
				
			||||||
@ -554,17 +554,14 @@ export class CoreMimetypeUtilsProvider {
 | 
				
			|||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        extension = this.cleanExtension(extension);
 | 
					        extension = this.cleanExtension(extension);
 | 
				
			||||||
 | 
					        const extensionGroups = this.extToMime[extension] && this.extToMime[extension].groups;
 | 
				
			||||||
 | 
					        let found = false;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (groups?.length && this.extToMime[extension]?.groups) {
 | 
					        if (groups.length && extensionGroups) {
 | 
				
			||||||
            for (let i = 0; i < this.extToMime[extension].groups!.length; i++) {
 | 
					            found = extensionGroups.some((group => groups.includes(group)));
 | 
				
			||||||
                const group = this.extToMime[extension].groups![i];
 | 
					 | 
				
			||||||
                if (groups.indexOf(group) != -1) {
 | 
					 | 
				
			||||||
                    return true;
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        return false;
 | 
					        return found;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user