MOBILE-4270 data: Catch errors when deleting

main
Noel De Martin 2023-03-30 16:17:28 +02:00
parent 7fb0c2be47
commit 479dac66a1
1 changed files with 3 additions and 1 deletions

View File

@ -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);