diff --git a/src/addons/mod/data/services/data-helper.ts b/src/addons/mod/data/services/data-helper.ts index 52b822c95..40751a9c5 100644 --- a/src/addons/mod/data/services/data-helper.ts +++ b/src/addons/mod/data/services/data-helper.ts @@ -714,7 +714,9 @@ export class AddonModDataHelperProvider { courseId = await this.getActivityCourseIdIfNotSet(dataId, courseId, siteId); } - AddonModData.deleteEntry(dataId, entryId, courseId!, siteId); + if (courseId) { + await AddonModData.deleteEntry(dataId, entryId, courseId, siteId); + } } catch (message) { CoreDomUtils.showErrorModalDefault(message, 'addon.mod_data.errordeleting', true);