Skip to content

Commit 2c70222

Browse files
committed
Minor: Exercise: Avoid NOTICE when importing AIKEN through textarea
1 parent 2dd8938 commit 2c70222

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

main/exercise/export/aiken/aiken_import.inc.php

+5-1
Original file line numberDiff line numberDiff line change
@@ -215,8 +215,10 @@ function get_and_unzip_uploaded_exercise($baseWorkDir, $uploadPath)
215215
function aikenImportExercise($file = null, $request = [])
216216
{
217217
$exerciseInfo = [];
218+
$fileIsSet = false;
218219

219220
if (isset($file)) {
221+
$fileIsSet = true;
220222
// The import is from aiken file format.
221223
$archivePath = api_get_path(SYS_ARCHIVE_PATH).'aiken/';
222224
$baseWorkDir = $archivePath;
@@ -379,7 +381,9 @@ function aikenImportExercise($file = null, $request = [])
379381
}
380382

381383
// Delete the temp dir where the exercise was unzipped
382-
my_delete($baseWorkDir.$uploadPath);
384+
if ($fileIsSet) {
385+
my_delete($baseWorkDir.$uploadPath);
386+
}
383387

384388
return $lastExerciseId;
385389
}

0 commit comments

Comments
 (0)