Skip to content

Commit

Permalink
Fix notice when you try to import an empty XML file.
Browse files Browse the repository at this point in the history
  • Loading branch information
tjhunt committed Jan 10, 2008
1 parent 33d2459 commit d67aacd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion grade/import/xml/lib.php
Expand Up @@ -37,7 +37,8 @@ function import_xml_grades($text, $course, &$error) {

$content = xmlize($text);

if ($results = $content['results']['#']['result']) {
if (!empty($content['results']['#']['result'])) {
$results = $content['results']['#']['result'];

foreach ($results as $i => $result) {
if (!$grade_items = grade_item::fetch_all(array('idnumber'=>$result['#']['assignment'][0]['#'], 'courseid'=>$course->id))) {
Expand Down

0 comments on commit d67aacd

Please sign in to comment.