Skip to content

Commit

Permalink
Issue #84 Throw exception for the empty new cmid
Browse files Browse the repository at this point in the history
  • Loading branch information
TomoTsuyuki committed Jan 11, 2024
1 parent 76b8381 commit f0a5d5a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions classes/massactionutils.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,9 @@ public static function duplicate_cm_to_course(object $course, object $cm): int {
}
}
}
if (empty($newcmid)) {
throw new \moodle_exception('Could not duplicate course module from id ' . $cm->id);
}
return $newcmid;
}
}

0 comments on commit f0a5d5a

Please sign in to comment.