#117 Do not process image if 'No image' selected

This commit is contained in:
Mark Nelson 2017-06-23 13:00:25 +08:00
parent 3a142506c7
commit c90a3445e5

View file

@ -143,6 +143,10 @@ class element extends \mod_customcert\element {
* @return string the json encoded array * @return string the json encoded array
*/ */
public function save_unique_data($data) { public function save_unique_data($data) {
if (empty($data->fileid)) {
return;
}
// Array of data we will be storing in the database. // Array of data we will be storing in the database.
$fs = get_file_storage(); $fs = get_file_storage();
$file = $fs->get_file_by_id($data->fileid); $file = $fs->get_file_by_id($data->fileid);