MOBILE-3653 course: Fix error in console on app start

main
Dani Palou 2021-03-26 10:52:22 +01:00
parent 8ea94c5ac3
commit bd07f10cfb
1 changed files with 5 additions and 0 deletions

View File

@ -37,6 +37,11 @@ export class CoreCourseLogCronHandlerService implements CoreCronHandler {
*/
// eslint-disable-next-line @typescript-eslint/no-unused-vars
async execute(siteId?: string, force?: boolean): Promise<void> {
if (!siteId && !CoreSites.isLoggedIn()) {
// No current site, stop.
return;
}
const site = await CoreSites.getSite(siteId);
return CoreCourse.logView(site.getSiteHomeId(), undefined, site.getId(), site.getInfo()?.sitename);