Commit f2ad6132 authored by jun's avatar jun
Browse files

MDL-61537 assignfeedback_editpdf: Check for existence of old test images

Since error suppression was removed with the call to unlink() to make
sure that there are no previous test image files before testing for the
gs path, make sure that it exists first before deleting to prevent it
from throwing any errors.
parent 00229165
......@@ -737,7 +737,11 @@ class pdf extends \FPDI {
$testimagefolder = \make_temp_directory('assignfeedback_editpdf_test');
unlink($testimagefolder . '/' . self::IMAGE_PAGE . '0.png'); // Delete any previous test images.
$filepath = $testimagefolder . '/' . self::IMAGE_PAGE . '0.png';
// Delete any previous test images, if they exist.
if (file_exists($filepath)) {
$pdf = new pdf();
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment