From 3b61d1ffa8767129ec8e38a1f4bfc13f3a10eac3 Mon Sep 17 00:00:00 2001 From: Mark Nelson Date: Fri, 23 Jun 2017 13:00:25 +0800 Subject: [PATCH] #117 Do not process image if 'No image' selected --- element/image/classes/element.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/element/image/classes/element.php b/element/image/classes/element.php index dd314d0..94f4b39 100644 --- a/element/image/classes/element.php +++ b/element/image/classes/element.php @@ -143,6 +143,10 @@ class element extends \mod_customcert\element { * @return string the json encoded array */ public function save_unique_data($data) { + if (empty($data->fileid)) { + return; + } + // Array of data we will be storing in the database. $fs = get_file_storage(); $file = $fs->get_file_by_id($data->fileid);